How do I populate a select?
| From: | Steve Jackson | Date: | Tue, 10 Dec 2002 15:24:19 +0000 |
| Subject: | How do I populate a select? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-127653@lists.php.net to get a copy of this message | ||
How do I populate a select list with a list of category names from a DB?
I can select the names using a query but how do I loop through them to
display them in a select?
My query below will return the cat names. (when I do something with it
like echoing the result)
$mysql = mysql_query("SELECT catname FROM categories ORDER BY catid");
But I want to give each catname in the DB a unique name in a form select
and don't know how to go about it.
Tutorials or tips anyone?
Regards,
Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
stephen.jackson@violasystems.com
Mobile +358 50 343 5159