I am trying to use dynamic inputs from a form to query mysql database. The table looks like below: [table] [tr][td]id[/td][td]question[/td][td]answer[/td][/tr] [tr][td]1[/td][td]3[/td][td]2[/td][/tr] [tr][td]2[/td][td]4[/td][td]4[/td][/tr] [tr][td]5[/td][td]3[/td][td]2[/td][/tr] [tr][td]5[/td][td]4[/td][td]4[/td][/tr] [tr][td]5[/td][td]5[/td][td]5[/td][/tr] [/table] The above table is the result of inputs from the form. All I am trying to do is to create php code to go through the table and grab the "id" where (question=3 AND answer=2) and (question=4 AND answer=4) and (question=5 AND answer=5) for all possible "id" for the condition specified. Please help!