note 43489 added to function.mysql-fetch-assoc
| From: | matt at teddybearmafia dot com | Date: | Wed, 23 Jun 2004 05:35:43 +0000 |
| Subject: | note 43489 added to function.mysql-fetch-assoc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-71527@lists.php.net to get a copy of this message | ||
Whenver you use the mysql_fetch_assoc(), it removes the current entry. This makes it work with the
while statement, but causes problems if you try to use a check before the while statement.
if (mysql_fetch_assoc($request))
{
//The first row was removed in the check, you're one short!
while ($row = mysql_fetch_assoc($request))
{
echo 'In WHILE loop';
}
}
----
Manual Page -- http://www.php.net/manual/en/function.mysql-fetch-assoc.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43489
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43489&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43489&report=yes
Search -- http://master.php.net/manage/user-notes.php