I have a html form where there are two Input fields say Caste (options are SC, ST and OBC) and Direction (options are north, south, east and west). Users will choose the options using check box.
<input name="ct" type="checkbox" value="SC">SC
<input name="ct" type="checkbox" value="ST">ST
<input name="ct" type="checkbox" value="OBC">OBC
<input name="dr" type="checkbox" value="N">North
<input name="dr" type="checkbox" value="S">south
<input name="dr" type="checkbox" value="E">East
<input name="dr" type="checkbox" value="W">West
I have also a database (name : PEOPLE) with column name Caste , Direction etc.
Now I want to run a sql query based on user's selection. For example
mysql_query("select * from PEOPLE where Caste='option/options selected by user' and Direction= 'option/options selected by user' ")
If user choose one option from each field then it is not a problem for me,
mysql_query("select * from PEOPLE where Caste='$_POST[ct]' and Direction= '$_POST[dr]' ")
but if they use multiple options , then how should I proceed.