I'm using UnixODBC with PHP 5.2.4 on Ubuntu 8.04 LTS and trying to pull all the results from a table sitting on an iSeries and replicate them to a local MySQL table.
Code-wise it is working with no errors but I'm ending up with more rows that what is contained on the iSeries.
I should end up with 25,613 rows but PHP reports that 25,630 rows are being inserted into the MySQL database:
$counter = 0;
while($row = odbc_fetch_array($result)) {
//Insert into MySQL using Zend Framework
$counter++;
}
echo $counter;
When I look in the MySQL database some of the rows are actually duplicated. I saw a note on the odbc_fetch_array() documentation about erratic behavior when accessing the iSeries, but trying that solution causes the script to run and run without ever seeming to finish.
Any ideas on what to check?