note 44232 added to ref.mysql

From: Date: Mon, 19 Jul 2004 05:54:48 +0000
Subject: note 44232 added to ref.mysql
Groups: php.notes 
Request: Send a blank email to php-notes+get-73585@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+44232 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44232&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44232&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#73585) next »