I have a table name as directory , i am sending a three parameter state, city and occupation.
my table structure is as follows:
id, name, occupation, pro_cat1, pro_cat2, pro_cat3, pro_cat4, pro_cat5, state , city
so i am sending three parameter and want to get data through IN
method. i am using this query
select *
from directory
where state = '".$_REQUEST['state']."' AND
city = '".$_REQUEST['city']."' AND
'".$_REQUEST['occupation']."' IN
(occupation, pro_cat1, pro_cat2, pro_cat3, pro_cat4, pro_cat5) AND
status=1
Order by rand()
this query is working fine but only detect a data from occupation and pro_cat1, if i want to search in all 6 filed which i added to IN
method then no data found msg display. what is the error in the query???