Reply to mysql table into associated array HOWTO??
Posted by p cooper on 10/03/05 10:17
Sorry if this isnt the correct place- I cant find an obvious PHP/MySQL NG
A 2 column table and i want row 1 to be the key and row 2 to be the value
$result = mysql_query("SELECT * FROM table");
while($row=mysql_fetch_row($result)){
$array['$row[0]']=$row[1]
}
which doesnt work .
im after the equivalent (in perl) of keys%array and values%array functions