예제 #1
0
<?php

require __DIR__ . '/../include/pageboot.php';
$fName = 'php://stdout';
if (is_array($argv) && array_key_exists('1', $argv)) {
    $fName = $argv[1];
}
$fh = fopen($fName, 'w');
$statement = $GLOBALS['db']->query(' SELECT * FROM `person_to_person` WHERE or_codFisc <> "" AND codFisc <> ""');
$resultSet = new \Zend\Db\ResultSet\ResultSet();
$resultSet->initialize($statement->execute());
fwrite($fh, '"OR","DEST"' . PHP_EOL);
while ($resultSet->valid()) {
    $row = $resultSet->current();
    fwrite($fh, '"' . $row['or_codFisc'] . '","' . $row['codFisc'] . '"' . PHP_EOL);
    $resultSet->next();
}
fclose($fh);