I have the following setup:
An array in php like this:
$arr = array(1, 2, 3, 4);
A query that looks like this:
SELECT `epicThing` FROM `epicTable` AS `epic`
WHERE
SELECT `ids` FROM `someTable`
WHERE `epic`.`somethingSomething` = `someTable`.`somethingElse`
(<<<< HERE IS MY PROBLEM >>>>)
The subquery returns something like (1, 2, 3, 4, 5, 6, 7, 8, 9).
Now what I need to check is that each of the elements from the array is in that returned answer of the subquery.
Basically something like
SELECT `epicThing` FROM `epicTable` AS `epic`
WHERE
'1' IN (
SELECT `ids` FROM `someTable`
WHERE `epic`.`somethingSomething` = `someTable`.`somethingElse`
)
AND
'2' IN (
SELECT `ids` FROM `someTable`
WHERE `epic`.`somethingSomething` = `someTable`.`somethingElse`
)
AND
'3' IN (
SELECT `ids` FROM `someTable`
WHERE `epic`.`somethingSomething` = `someTable`.`somethingElse`
).......
But for each element.
For simplicity let's assume that elements are always in order (because I will probably need to convert the array to string), if is not possible otherwise. But I would prefer a general solution if available.
What I DON'T want to do is to get data in php and check it there (this is only a really really small part of a huge query).