note 70195 deleted from control-structures.while by bobby
| From: | bobby@php.net | Date: | Fri, 06 Oct 2006 18:25:15 +0000 |
| Subject: | note 70195 deleted from control-structures.while by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118151@lists.php.net to get a copy of this message | ||
Note Submitter: startide at free dot Fr
----
W00t, I noticed I posted a wrong code ^^
The way I did it, you won't display anything !!
You need to either : echo each line OR echo $menu after the while ==>
<select name="whatever">
<?php
while ($data = mysql_fetch_assoc($requeteID))
{
$menu .= '<option value="'.$data['id'].'"';
$menu .= ($data['id'] == $_GET['id'] ? ' selected>'
:'>');
$menu .= $data['name'].'</option>';
}
echo $menu;
?>
</select>
that way its gonna work ;)