I've been scratching my head for a bit now and I can't think of a way to make a mysql_query pull a set of data that matches a number in an array.
It's easier to explain what I want to do with code.. so here goes..
Then I need my mysql_query to be able to select rows from my database table where, lets say for example, id = any of the values in $test. like this:
$test = 1;
$new_result = mysql_query("SELECT * FROM something WHERE id = $test");
Now that's all great and dandy, BUT, the content of id is a set of numbers for example... lets say there are 20rows of data where id is of type text and contains 4 different random numbers..
Row 1... id= 4,1,5,9
Row 2... id= 6,7,3,1
Row 3... id= 9,0,4,5
Row 4... id= 6,1,2,9
etc...
. So what I need this to do, is for the mysql_query to pick up every row where one of the numbers in id is equal to $test.
So $new_result would end up pulling Row 1, 2 and 4
I assume you'd use the explode function, but I'm not quite sure how.