Creating a Doctrine query with a different number of ids

Posted by frapet on Stack Overflow See other posts from Stack Overflow or by frapet
Published on 2012-12-06T16:05:14Z Indexed on 2012/12/06 17:04 UTC
Read the original article Hit count: 137

Filed under:
|
|

Is it possible to create a Doctrine query with a differnt number of ids coming from a submitted form? And if yes how?

What I am trying to do is this:

 ....

 if ($input->isValid()) {

$q = Doctrine_Query::create()
                ->from('Imm_Model_Images i')
                ->whereIn('i.ImageID = ?', array($input->ids));

$result = $q->fetchArray();

PS: ids come form the submitted form in an array as ids[].

Added Edit:

chaged the above line:

->whereIn('i.ImageID = ?', array($input->ids));

with:

->whereIn('i.ImageID = array($input->ids)');

...and it seems to work.

© Stack Overflow or respective owner

Related posts about php

Related posts about sql