I'm a beginner with basic PHP knowledge. I have a multiple drop down menu item list that queries my database. On submit I would like to show the description of the item selected from the database.
My query
$cat3=$_GET['cat3'];
if(isset($cat3) and strlen($cat3) > 0){
$quer3="SELECT DISTINCT subcat2, detail FROM subcategory2 where subcat_id=$cat3 order by subcat2";
}else{$quer3="SELECT DISTINCT subcat2 FROM subcategory2 order by subcat2"; }
What's being posted on sumbit
echo "<select name='subcat3' ><option value=''>Select one</option>";
foreach ($dbo->query($quer3) as $noticia) {
echo "<option value='$noticia[subcat2]'>$noticia[subcat2]</option>";
}
echo "</select>";
Is it possible to pass my detail field along within subcat3 or do I have to create another table named details and another query ($quer4) and link it by the subcat2 id?
Any general information similar to an item search result(ebay) would help.