note 26667 added to function.mysql-fetch-object
| From: | mw at suk dot net | Date: | Fri, 08 Nov 2002 15:57:12 +0000 |
| Subject: | note 26667 added to function.mysql-fetch-object | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39172@lists.php.net to get a copy of this message | ||
If you want to for instance fetch all results in one step and save them in an array then use
something like:
$rs = mysql_query("select a, b, c from example");
// create the array
$example_array = array();
for ($i = 0; $i < $rs; $i++) {
$example_array[$i] = array();
$example_array[$i] = mysql_fetch_object($rs);}
Now you can access those fields with instance like
$example_array[0]->a;
--
http://www.php.net/manual/en/function.mysql-fetch-object.php
http://master.php.net/manage/user-notes.php?action=edit+26667
http://master.php.net/manage/user-notes.php?action=delete+26667
http://master.php.net/manage/user-notes.php?action=reject+26667