note 50333 deleted from function.odbc-fetch-array by philip
| From: | philip@php.net | Date: | Sun, 21 Dec 2008 15:15:26 +0000 |
| Subject: | note 50333 deleted from function.odbc-fetch-array by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-148420@lists.php.net to get a copy of this message | ||
Note Submitter: jezndiatyahoodotcodotuk
----
This function is undefined in 4.1.2 (RedHat 7.3) despite the claims of the documentation.
It's just too useful a function not to have, particularly if your database is prone to change.
Here's my quick and dirty version:
function odbc_fetch_array($resource, &$array)
{
$array=array(); // Truncate the array first...
if (! $int = odbc_fetch_into ($resource, $result_array))
return false;
for ($i=1; $i <= $int; $i++)
{
$array[odbc_field_name($resource, $i)] = $result_array[$i - 1];
}
return true;
}