note 31329 added to function.odbc-fetch-array

From: Date: Thu, 17 Apr 2003 16:01:37 +0000
Subject: note 31329 added to function.odbc-fetch-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-46741@lists.php.net to get a copy of this message
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; } } -- http://www.php.net/manual/en/function.odbc-fetch-array.php http://master.php.net/manage/user-notes.php?action=edit+31329 http://master.php.net/manage/user-notes.php?action=delete+31329 http://master.php.net/manage/user-notes.php?action=reject+31329

« previous php.notes (#46741) next »