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
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.