mysql_query("SELECT myArray FROM myTable WHERE my_id IN ('".implode("', '", array_map('mysql_real_escape_string', $array))."') LIMIT 1");
Edit
I think I see what you're trying to do. You could use mysql LIKE for this, but its really inefficient (it has to do a full table scan). You shouldn't store lists of values in one field in mysql.
You want to create a one-to many relationship between entities. Because you havn't really given us much information, we'll call the entities stored in your table foos. So you have a table named foos
that stores your foos. Each foo has a relationship with a number of bars, which are currently being stored in an 'array'. This is called a one-to-many relationship. These bars need to be in a separate table calls bars
. You will store one bar per row, and each bar is associated with one foo, so you store foo's id along with each bar. If you wan to find which foos are associated with a certain bar, you just do a simple join.
If bars can be shared between many foos, this is called a many-to-many mapping. Then you need one table for foos, one table for bars, and a third table to map foos to bars. Then you can search which foos are associated with which bars, and which bars are associated with which foos.