Re: Populating Dropdown with MYSQL data

From: Date: Fri, 15 Mar 2002 16:09:56 +0000
Subject: Re: Populating Dropdown with MYSQL data
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-88667@lists.php.net to get a copy of this message
<select name="somename"> <?php $sql = "SELECT id, name FROM table"; $res = mysql_query($sql); while (list($id, $name) = mysql_fetch_array($res)) { echo "<option value=\"$id\">$name</option>"; } ?> </select> -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 "Jeff Dale" <jeff.dale@compaq.com> wrote in message news:20020315155854.76891.qmail@pb1.pair.com... > I want to have a dropdown list populated with data from my MySql server. > > Any examples or websites that could help is appreciated. > >

« previous php.general (#88667) next »