note 70195 added to control-structures.while
| From: | startide at free dot Fr | Date: | Fri, 06 Oct 2006 12:41:11 +0000 |
| Subject: | note 70195 added to control-structures.while | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-118125@lists.php.net to get a copy of this message | ||
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 ;)
----
Server IP: 195.221.21.36
Probable Submitter: 193.194.132.43 (proxied: 10.221.10.44)
----
Manual Page -- http://www.php.net/manual/en/control-structures.while.php
Edit -- https://master.php.net/note/edit/70195
Del: integrated -- https://master.php.net/note/delete/70195/integrated
Del: useless -- https://master.php.net/note/delete/70195/useless
Del: bad code -- https://master.php.net/note/delete/70195/bad+code
Del: spam -- https://master.php.net/note/delete/70195/spam
Del: non-english -- https://master.php.net/note/delete/70195/non-english
Del: in docs -- https://master.php.net/note/delete/70195/in+docs
Del: other reasons-- https://master.php.net/note/delete/70195
Reject -- https://master.php.net/note/reject/70195
Search -- https://master.php.net/manage/user-notes.php