Given an array of ids $galleries = array(1,2,5) I want to have a SQL query that uses the values of the array in its WHERE clause like:
$galleries = array(1,2,5)
Use:
select id from galleries where id in (1, 2, 5);
A simple for each loop will work.
for each
Flavius/AvatarKava's way is better, but make sure that none of the array values contain commas.