Possible Duplicate:
I have an array of integers, how do I use each one in a mysql query (in php)?
I am trying to create some filtering function and I would like to know if it is possible, within a mysqli query, to check if the table row has a value equal to just one of those in the array. I hope the code will make it clearer:
$age=array(37,35);
$query = mysqli_query($link, "SELECT * FROM users WHERE age = $age");
So I want the query to return all the rows of users whose age is either 37 or 35, but the above code doesn't work.
Using
...WHERE age = 35 OR age = 37"
Won't do, because I want it to be dynamic so to speak.
Thanks