RE: [PHP] question on listbox.
| From: | Leonard Burton | Date: | Sat, 01 Feb 2003 13:42:44 +0000 |
| Subject: | RE: [PHP] question on listbox. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133879@lists.php.net to get a copy of this message | ||
Might this be better?
print "<select name=category_selection>\n";
print "<option value=0>Select Category</option>"\n
//Query
$sql="SELECT DISTINCT CategoryName From Categories ORDER BY CategoryName";
$result=mysql_query($sql);
if ($result)
{
While($Category=mysql_fetch_array($result))
{
Print"<OPTION
VALUE=\"$Category['auto']\">$Category['name']</option>\n";
}
mysql_free_result($result[$a]);
print "</select>\n";
}
Leonard.
www.phpna.com