Jump to content

Help with select list


rdub

Recommended Posts

I currently use this to populate a select list. Need to make a change so that it will populate with all options except "individual". How might I do this?

 

<form ID="form1" Category Listing"form1" class="style1 style2" method="get" >

Business Categories:

<select name="select" class="style1 style2" onChange="next(form1.select.value);">

<option value="">--- Select ---</option>

<?

// Get records from database (table "member_list").

$list=mysql_query("select distinct Category_Listing from member_list order by Category_Listing");

 

// Show records by while loop.

while($row_list=mysql_fetch_assoc($list)){

?>

<option value="<? echo $row_list['Category_Listing']; ?>"

<? if($row_list['ID']==$select){ echo "selected"; } ?>>

<? echo $row_list['Category_Listing']; ?></option>

<?

// End while loop.

}

?>

</select>

</form>

Link to comment
https://forums.phpfreaks.com/topic/119238-help-with-select-list/
Share on other sites

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.