note 44233 added to ref.mysql
| From: | rushik_life at yahoo dot com | Date: | Mon, 19 Jul 2004 05:54:58 +0000 |
| Subject: | note 44233 added to ref.mysql | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-73586@lists.php.net to get a copy of this message | ||
for fetching a table into 2D array with field names using metadata
<?// fetch table data into 2D array.
for($i=0; $i<mysql_num_rows($result); $i++)
{
//advances the row in the mysql resource $result
mysql_data_seek($result,$i);
//assigns the two dim array keys, $users[row][field]
$users[$i]=mysql_fetch_row($result);
}
//fetch the field names
for($j=0;$j<$tt;$j++)
{
$meta = mysql_fetch_field($result, $j);
$flds[$j]=$meta->name;
}
//fetch table name
----
Manual Page -- http://www.php.net/manual/en/ref.mysql.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44233
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44233&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44233&report=yes
Search -- http://master.php.net/manage/user-notes.php