note 51177 added to function.mysql-fetch-array
| From: | aksel at post dot com | Date: | Tue, 22 Mar 2005 20:15:39 +0000 |
| Subject: | note 51177 added to function.mysql-fetch-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86803@lists.php.net to get a copy of this message | ||
An easy way to create a 2-dimensional array out of mysql table "table0" with
"field0" as key:
<?php
$result=mysql_query("select * from table0", $link);
$table0_array=array();
while($line=mysql_fetch_array($result, MYSQL_ASSOC)){
$table0_array[$line["field0"]]=$line;
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.mysql-fetch-array.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51177
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51177&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51177&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51177&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51177&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51177&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51177&report=yes
Search -- http://master.php.net/manage/user-notes.php