Jump to content

displaying drop down menus


fife

Recommended Posts

Is this what you're talking about?

 

$query = "SELECT `id`, `name` FROM `table`";
$result = mysql_query($query);
echo "<select name=\"select_field\">\n";
while( $array = mysql_fetch_assoc($result) ) {
     echo "<option value=\"{$array['id']}\">{$array['name']}</option>\n";
}
echo "</select>\n";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.