sql - PHP: How to display 2 column values in dropdownlist -
i have code:
echo "<select name='brand'"><option value=''>select one</option>"; foreach ($dbo->query($quer3) $noticia3) { if($noticia3['id']==@$brand) { echo "<option selected value='$noticia3[id]'>$noticia3[brand]</option>"."<br>"; } else { echo "<option value='$noticia3[id]'>$noticia3[brand]</option>"; } }
i want add column displayed drop down list. example:
echo "<option selected value='$noticia3[id]'>$noticia3[brand]+$noticia3[site]</option>"."<br>";
as can see, want add "site" column. do?
you following:
echo "<select name='brand'"><option value=''>select one</option>"; foreach ($dbo->query($quer3) $noticia3) { if($noticia3['id']==@$brand) { echo "<option selected value='$noticia3[id]'>" . $noticia3[brand] . " " . $noticia3[site] . "</option><br />"; } else { echo "<option value='$noticia3[id]'>" . $noticia3[brand] . " " . $noticia3[site] . "</option>"; } }
this should work solution want.
Comments
Post a Comment