Voting

: max(one, seven)?
(Example: nine)

The Note You're Voting On

eion at robbmob dot com
2 years ago
This function can also return 'false' if there was a row with corrupt data (eg bad binary data or invalid locale data) depending on what ODBC driver you're connecting to. Subsequent calls to odbc_fetch_array() will still return results in those cases.

Either compare the number of rows fetched using the odbc_num_rows() function (if the driver provides such data), or verify that there's not some extra data after the failing rowduring your while loops:

<?php
// Allow for up to two sequential rows of bad/corrupt data
while(($row = odbc_fetch_array($res)) || ($row = odbc_fetch_array($res)) || ($row = odbc_fetch_array($res))) {
var_dump($row);
}
?>

Seen in the wild when using PHP's ODBC to talk to Informix and Foxpro databases.

<< Back to user notes page

To Top