Developing software in the Real World

IN and Zend\Db\Sql's where()

This is a short note to myself. Zend\Db\Sql objects allow you to do this:

which generates the (My)SQL:

If you want the SQL generated to use the IN operator, then just pass in an array:

which generates:

This obviously also works for ZendDbSql‘s update() as well as select().

Thoughts? Leave a reply

Your email address will not be published. Required fields are marked *