note 127471 added to function.odbc-fetch-array

From: Date: Tue, 09 Aug 2022 09:56:50 +0000
Subject: note 127471 added to function.odbc-fetch-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-219410@lists.php.net to get a copy of this message
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. ---- Server IP: 45.112.84.4 Probable Submitter: 185.85.3.173 (proxied: 101.98.39.81) ---- Manual Page -- https://php.net/manual/en/function.odbc-fetch-array.php Edit -- https://main.php.net/note/edit/127471 Del: integrated -- https://main.php.net/note/delete/127471/integrated Del: useless -- https://main.php.net/note/delete/127471/useless Del: bad code -- https://main.php.net/note/delete/127471/bad+code Del: spam -- https://main.php.net/note/delete/127471/spam Del: non-english -- https://main.php.net/note/delete/127471/non-english Del: in docs -- https://main.php.net/note/delete/127471/in+docs Del: other reasons-- https://main.php.net/note/delete/127471 Reject -- https://main.php.net/note/reject/127471 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#219410) next »