On Monday 29 March 2004 03:27, [EMAIL PROTECTED] wrote: > I am trying to construct an array with key-value from a resultSet which > will be used often within the page or between pages. > > Which looks like this: > > $optionBox="select used_1, rub from rub_table order by rub asc"; > $rs_box=mysql_query($optionBox,$con); > $arr=Array( > while($row=mysql_fetch_array($rs_box)) > { > '$row["used_1"]' => '$row["rub"]' , > }); > > ,---> This does not need to appear in the last loop. > > Is this possible?
No. Try: $optionBox="select used_1, rub from rub_table order by rub asc"; $rs_box=mysql_query($optionBox,$con); while($row=mysql_fetch_array($rs_box)) { $my_array[$row['used_1']] => $row['rub']; } print_r($my_array); -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* It is impossible for an optimist to be pleasantly surprised. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php