Re: Populating a dropdown listbox from a database?
| From: | kevin at oceania dot net | Date: | Tue, 17 Oct 2000 00:34:27 +0000 |
| Subject: | Re: Populating a dropdown listbox from a database? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-20487@lists.php.net to get a copy of this message | ||
Daniel Convissor wrote:
>
> Hi Jari:
>
> > How do I populate a listbox from a database?
> > I have a table which i want to use to populate a listbox in a form .
$result=mysql("dbname","SELECT * FROM tablename");
while ($row = mysql_fetch_row($result)) {
echo "<option value=\"$row[1]\"> $row[1] </option>";
}
--
Kind regards
Kevin Waterson
CEO OceaniaTLA