note 97078 rejected from language.types.array by danbrown
| From: | danbrown@php.net | Date: | Wed, 31 Mar 2010 16:25:36 +0000 |
| Subject: | note 97078 rejected from language.types.array by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-167581@lists.php.net to get a copy of this message | ||
Note Submitter: whodesignwho at googlemail dot com
----
in the following php code which retrives data from MySQL:
while ($menu_row = mysqli_fetch_array($result, MYSQLI_NUM)) {
echo "<option
value=\"$menu_row[0]\">$menu_row[1]</option>\n";
}
For the purpose of store each set of $menu_row[0] => $menu_row[1] during the loop into a array
for later use,How do I achieve that?
For example:
while(){
$new_array[] = $menu_row[0] => $menu_row[1];
}
It just doesn't work.