Very simple array question
Posted: Tue Aug 03, 2010 12:15 pm
I want to build an array from two values in a MySQL table. Although the code sample below doesn't work, I think it will show what I'm trying to do:
I appreciate any help.
Code: Select all
$sql=mysql_query("SELECT id, label FROM table");
while ($form=mysql_fetch_array($sql)){
$labelset= array($form[id] => $form[label]);
}
echo $labelset[14];
echo $labelset[5];