cayley wrote:
>
> A related question: do you know if the where method of zend_db_select will
> also do this?
>
You can do either of the following to accomplish this:
$where = $db->quoteInto("id in ( ? )", $id);
$select = $db->select()->from('resource')->where($where);
Or
$select = $db->select()->from('resource')->where('id in (?)', array( $id
));
The latter example makes the $id array an element of another array.
Zend_Db_Select::where() supports multiple placeholders in an expression, and
it interprets an array argument as an array of values to interpolate into
the respective placeholders. However, if one of these values is in turn an
array, it passes that to quoteInto() and it uses that method's support for
comma-separated lists.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Passing-array-of-values-to-db-statement-tp15813319s16154p15815470.html
Sent from the Zend Framework mailing list archive at Nabble.com.