1

I have the following function:

public function findByIds($ids = array())
{
    return Database :: fetchAll('SELECT * FROM foo_bar WHERE test = 0 AND id IN :ids', array(
        array(':ids', $ids)
    ));
}

But it doesn't work of course. The $ids variable has the following structure:

array(3) { [0]=> array(1) { ["id"]=> string(3) "101" } [1]=> array(1) { ["id"]=> string(3) "102" } [2]=> array(1) { ["id"]=> string(3) "110" } }

How can I match my query to find only rows specified by ids from my array?

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
Karol Hernik
  • 133
  • 7

0 Answers0