View Full Version : Putting MySQL Result Data into Array, not printing

sir pannels
11-01-2006, 09:59 AM
morning all,

I'm using a pear class to build a chart, the chart gets build by an array of data.. example array :

$DS[0][0] =& Image_Graph::factory('dataset', array(array('A' => 1, 'B' => -2, 'C' => 1, 'D' => 3, 'E' => -1)));

That works great no problem, I'm not trying to populate that array from a mysql result ..

I have some mysql stuff, query etc and then ..

while ($row = mysql_fetch_array($result)) {


Now im stuggilin to populate the array with each row, obviously it goes in the middle of that while loop ..

The best way to do it ... ?

any pointers would be apperciated
cheers all
p :D

11-01-2006, 12:39 PM
$result = mysql_query($sql);
for($rowset = array(); $row = mysql_fetch_array($result); $rowset[] = $row);

sir pannels
11-01-2006, 01:23 PM
Thanks for your help ..sorted.. much apperciated. *bookmarked*