I have the following drop down list, that has a common item 'a'. This item is shown two times in output, but it want to have it only once. Can anybody help me?
<select name="">
<option value="a">a</option>
<option value="a">a</option>
<option value="b">b</option>
</select>
My code is
<select name="brand" id="brand" class="txtfld" >
<option value="">Select</option>
<?php
$country_sql="SELECT DISTINCT(brand) FROM customer where status='A' and brand<>''";
$result_country=executequery($country_sql);
while($country_array=ms_stripslashes(mysql_fetch_array($result_country)))
{
$sel_con=($country_array['brand']==$_REQUEST['brand'])? " selected='selected'" : " ";
$brand=$country_array['brand'];
$brand2=explode('|',$brand);
if(count($brand2)<2)
{
?><option value="<?=$brand;?>" ><?=$brand;?></option><?php
}
else
{
for($i=0;$i<count($brand2);$i++)
{
?><option value="<?=$brand2[$i];?>" ><?=$brand2[$i];?></option><?php
}
}
}
?>
</select>