> fetchinto? > On Mon, 2003-07-07 at 14:42, phpu wrote: > > 10x but i am new to php and i do not know how to dump all of the results > > into an array.... can you help me with this one please?
$sql="select * from cate order by name asc"; $resurs=mysql_query($sql); while ($row=mysql_fetch_array($resurs)) { $results_array[] = ( 'field_1' => $row['1'], 'field_2' => $row['2'], 'field_3' => $row['3'] ); } echo "<table border=1>\n"; for($i=0; $i<count($results_array);) { echo "\t<tr>\n"; for($j=0; $j<2; $j++) { echo "\t\t<td>".$results_array[$i]."</td>\n"; $i++; } echo "\t</tr>\n"; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php