hey all
having bit of a snag, I am populating dropdown boxes from a db. I can get stuff into the dropdowns for the most part, but there are situations where there will be option a or b for the same dropdown, for example..the products I am displaying will have either flavour or scent or colour, but never a combination, so I want to validate whether anything exists in the corresponding tables and if not move on to the next criteria to see if it exists.
I tried this:
<?php
while($flav=mysql_fetch_array($f_query)){
$flavour=$flav["f_flav"];
if($flavour==""){
while($sc=mysql_fetch_array($sc_query)){
$scent=$sc["sc_scent"];
echo ("<option value='$scent'>$scent\n");
}
exit();
}
else{
echo ("<option value='$flavour'>$flavour\n");
}
}
?>
but regardless it will either display flavour or a blank dropdown, I understand why, because there aren't any records that are null, so how would I test to see whether there is a record at all for flavour, scent and colour...I am assuming on the MySQL side??????
Thanks ahead of time....