I've been working on this too for a long time, (for making the correct query), but i ended up with a HUGE code.. then somebody told me how to solve it)
i would change those buttons infront of the search criteria into checkboxes...
then you can use this code:
btw, the checkboxes are named: bnsf, model and paint (the first three.. i'm not gonna make the entire thing), and if the boxes are checked, they're value is YES (small letters though)
something else: if the fields are not checked, it will show all the results from that particular thing......)
another thing (jeez🙂: the $bnsf is the checkbox, bnsf (first thing in array) is the column in the database, and $bnsftextfield is the selection box where you select the model)
BTW, if i were you, i would make another selection named EVERYTHING (or something along those lines...)
<?
if ($bnsf=="yes")
{
if ($bnsftextfield!="everything")
{
$array[]="bnsf='$bnsftextfield'";
}
}
if ($model=="yes")
{
if ($modeltextfield!="everything")
{
$array[]="model='$modeltextfield'";
}
}
if ($paint=="yes")
{
if ($painttextfield!="everything")
{
$array[]="paint='$painttextbox'";
}
}
if ($array!='')
{
$array=implode(" AND ",$array);
$sql=mysql_query("SELECT FROM table WHERE $array");
}
else
{
$sql=mysql_query("SELECT FROM table");
}
?>
with my search stuff, i didn't use the checkboxes in front of the criteria, i only used the everything option.....