note 31329 deleted from function.odbc-fetch-array by philip
| From: | philip@php.net | Date: | Sun, 21 Dec 2008 15:13:22 +0000 |
| Subject: | note 31329 deleted from function.odbc-fetch-array by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-148417@lists.php.net to get a copy of this message | ||
Note Submitter: andrea dot galli at acotel dot com
----
The next_record () function, checks if there is the odbc_fetch_array function in the installed
version of php.
If it doesn't exist, it call another function named odbc_fetch_array() made by me that it
returns the same result.
while(list($Record1, $Record2) = $next_record($Query_ID))
{
echo("$Record1 $Record2\n");
}
---
function next_record($Query_ID)
{
if(function_exists(odbc_fetch_array))
{
$Record = odbc_fetch_array($Query_ID);
}
else
{
$Record = $odbc_fetch_array($Query_ID);
}
$Row += 1;
$stat = is_array($Record);
if(!$stat)
{
odbc_free_result($Query_ID);
$Query_ID = 0;
}
return $Record;
}
function odbc_fetch_array($Query_ID, $RowNumber = -1)
{
if($RowNumber < 0)
{
odbc_fetch_into($Query_ID, $rs);
}
else
{
odbc_fetch_into($Query_ID, $rs, $RowNumber);
}
if(isset($rs))
{
return $rs;
}
else
{
return false;
}
}