note 56112 added to function.mysql-fetch-assoc
| From: | benlanc at ster dot me dot uk | Date: | Tue, 23 Aug 2005 23:25:52 +0000 |
| Subject: | note 56112 added to function.mysql-fetch-assoc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94100@lists.php.net to get a copy of this message | ||
It probably without saying, but using list() in conjunction with mysql_fetch_assoc() does not work -
use mysql_fetch_row() instead.
<?php
$sql = "SELECT
id,field,value FROM
table";
$result = mysql_query($sql);
// this results in empty values for rowID,fieldName,myValue
list($rowID,$fieldName,$myValue) = mysql_fetch_assoc($result);
// this is what you want:
list($rowID,$fieldName,$myValue) = mysql_fetch_row($result);
?>
----
Manual Page -- http://www.php.net/manual/en/function.mysql-fetch-assoc.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56112
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56112&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56112&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56112&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56112&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56112&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56112&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56112&report=yes
Search -- http://master.php.net/manage/user-notes.php