note 95764 added to function.odbc-fetch-array
| From: | armando dot ortiz at cppcorp dot com | Date: | Thu, 21 Jan 2010 00:20:38 +0000 |
| Subject: | note 95764 added to function.odbc-fetch-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165147@lists.php.net to get a copy of this message | ||
In trying to execute queries and looping through the results like so...
while( odbc_fetch_row( $myResultID ) )
{
$myRow = odbc_fetch_array( $myResultID );
$thisResult[ $myRow[ "column" ] ] = $myRow;
}
...I found that not only was my first row being skipped, but also every OTHER row was being skipped,
thus a known result set containing 14 rows would dwindle down to 7.
My solution is as follows as I needed to return an array of rows:
while( $myRow = odbc_fetch_array( $myResultID ) )
{
$thisResult[ $myRow[ "column" ] ] = $myRow;
}
----
Server IP: 69.147.83.197
Probable Submitter: 209.150.64.159
----
Manual Page -- http://www.php.net/manual/en/function.odbc-fetch-array.php
Edit -- https://master.php.net/note/edit/95764
Del: integrated -- https://master.php.net/note/delete/95764/integrated
Del: useless -- https://master.php.net/note/delete/95764/useless
Del: bad code -- https://master.php.net/note/delete/95764/bad+code
Del: spam -- https://master.php.net/note/delete/95764/spam
Del: non-english -- https://master.php.net/note/delete/95764/non-english
Del: in docs -- https://master.php.net/note/delete/95764/in+docs
Del: other reasons-- https://master.php.net/note/delete/95764
Reject -- https://master.php.net/note/reject/95764
Search -- https://master.php.net/manage/user-notes.php