db2_fetch_assoc() fails midway through iterating over result set
问题 I'm running on IBM i (an AS/400) V7R2, PHP v5.6.5, Zend Server v8.0.2. I have a query which takes less than a second to execute from iNavigator. When I run the same query from a PHP script and then loop through it using: $numRows = 0; while ($row = db2_fetch_assoc($stmt)) { //Do stuff $numRows++; } echo $numRows++; $numRows ends up only being a fraction of the expected result set and I get this error in the Zend logs: PHP Warning: db2_fetch_assoc(): Fetch Failure in /path/to/script.php on