Hello!
I try to make an "advanced" search field for users. (the users have 5-8 field to short the search list..)
I think i have to build the query depending on which posted field is not empty.
This is my original query, but with this, i got all the row from table..
$query = "select * from MYTABLE where FIELD1 LIKE '%$sample1%' OR FIELD2 LIKE '%$sample2%' OR FIELD3 LIKE '%$sample3%' OR FIELD4 LIKE '%$sample4%' order by name";
So i think i have to use IF statement in query, but i dont know how, i got error all time. And one more thing: If ths user is fill out the "sample4", then he must to fill "sample1". How can i check this?
Thank you for your help.