Re: Dynamic Dropdown menu question.
| From: | jtjohnston | Date: | Wed, 06 Feb 2002 02:03:58 +0000 |
| Subject: | Re: Dynamic Dropdown menu question. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-83665@lists.php.net to get a copy of this message | ||
Michael,
I think you're trying to kill yourself coding. here's what I do for myself:
<select name="from">
<option value="" SELECTED>Select Someone</option>
<?php
$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);
$news = mysql_query("select * from $table ORDER by LastName asc");
while ($mydata = mysql_fetch_object($news))
{
echo"<option
value=\"".$mydata->EM."\">".$mydata->FirstName."
".$mydata->LastName."</option>\n";
}
mysql_close($myconnection);
?>
</select>