Another Drop down question
| From: | Kim Kohen | Date: | Thu, 28 Mar 2002 01:18:50 +0000 |
| Subject: | Another Drop down question | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-17965@lists.php.net to get a copy of this message | ||
Hello all,
I'm trying for the first time to use a dynamically created popup menu from a
mysql database. The menu is of (article) writers' names and will be used in
a select query.
Using snippets of code I've gleaned from here and the mysql list, I've the
popup working fine but I'd like to include either a blank entry or a 'Search
all Writers' entry in the menu and this is where I'm stuck.
The code I have is:
$getlist = mysql_query("SELECT distinct Writer FROM stories");
echo " <select name=\"WriterName\">\n";
while ($row = mysql_fetch_array($getlist)) {
echo ' <option
value="'.$row["Writer"].'">'.$row["Writer"]."</option>\n";
}
echo " </select>\n";
If anyone could point me in the right direction or direct me to appropriate
documentation I'd be most appreciative.
Cheers and thanks
kim