Jump to content

Select Option List Help - Multiple Values Are The Same


twilitegxa

Recommended Posts

I have this code for a select option list:

 

<?php
$get_map = "select * from monsters1";
$get_map_res = mysql_query($get_map, $conn) or die(mysql_error());
echo "<select name=\"maps\" onchange=\"showMap(this.value)\">
<option selected=\"selected\">None Selected</option>";
while ($list_maps = mysql_fetch_array($get_map_res)) {
$map_id = $list_maps['id'];
$map = $list_maps['map'];
echo "<option value=\"$map_id\">$map</option>";
}
echo "</select>";
?>

 

But I have several records with the same value. How can I make it to where each value only displays once in my list?

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.