Hi people!
I got a problem building a search form.
I got a meny inputs (dropdown menus) and user can choose some, and in all of the dropdown menus is selectable "all" option. I'm planing that when user choose product or model for example and all of the other fields leave with "all" (blank), from database will be selected specific product or model no mether what is described in other fields which are not specified. So if user select more fields the result will be more exact.
What did I done:
I made a page with form, and a page for recordset which displaying results.
In form in dropdown lists where is "all" I leave value like "", like this:
<select name="door" id="door">
<option value="" selected="selected">All</option>
<option value="2">2/3</option>
<option value="4">4/5</option>
<option value="6">6/7</option>
</select>
Variables are parsing to another page with no problems, I did check with PHP echo.
On another page I made a MySql query:
$query_auto_lista = "SELECT * FROM auto_oglasi WHERE auto_oglasi.KAT='$kat' AND auto_oglasi.PROIZVODJAC='$proizvodjac' AND auto_oglasi.MODEL='$model' AND auto_oglasi.TIP='$tip' AND ('$cenaod'<=auto_oglasi.CENA AND auto_oglasi.CENA<='$cenado') AND auto_oglasi.KATEGORIJA='$kategorija' AND auto_oglasi.VRATA='$vrata' AND auto_oglasi.KS='$ks' AND ('$prviregod'<=auto_oglasi.PRVIREG AND auto_oglasi.PRVIREG<='$prviregdo') AND
....... And made do while fuction and all I need..
But it doesnt showing results. Its only showing them if all filds are maching.
What should I do? I dont need complete code, I just need an idea, or some practicle example.
Thanks in advance!!!