Re: Dynamically generate a drop down list
| From: | sven | Date: | Mon, 28 Jul 2003 11:46:19 +0000 |
| Subject: | Re: Dynamically generate a drop down list | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157168@lists.php.net to get a copy of this message | ||
... or even shorter (since php 4.1.0):
function init_auth_list()
{
print "<select name=author> <option value=\"\">select the name of the
author</option\>";
$query="select name from author order by name";
$result=pg_exec($GLOBALS["db"],$query);
while ($row = pg_fetch_row($result))
{
print "<option
name=\"".$row[0]."\">$row[0]</option>";
}
print "</select>";
}