go("SELECT codice, cf FROM b_enti WHERE codice_ausa IS NULL OR codice_ausa = ''")->fetchAll(PDO::FETCH_ASSOC); if (!empty($enti)) { $updateAusa = $pdo->prepare("UPDATE b_enti SET codice_ausa = :ausa WHERE codice = :codice"); foreach($enti AS $ente) { if (!empty($ente["cf"])) { $ausa = Ente::getAusaInfo($ente["cf"]); if (!empty($ausa["codice_ausa"])) { $updateAusa->bindValue(":codice",$ente["codice"]); $updateAusa->bindValue(":ausa",$ausa["codice_ausa"]); $updateAusa->execute(); } } } } writeQueueLog("0","aggiornamentoAusa"); } } ?>