I was wondering how I can get something like this:
SELECT * from `table` WHERE id='1' AND (title='hurr' OR title='durr')
in Zend framework? To my knowledge there are only
where() functions, which together make AND relationships and
orWhere() which adds an OR rule, but if used together, a select like this:
This would create a query like this
SELECT * from `table` WHERE id='1' AND title='hurr' OR title='durr'
Which is something completely different.
$select = $this->select()->where('id = 1')->where("title='durr' OR title='hurr'"); $select = $this->select()->where('id = 1')->where('title IN (?)', array('durr', 'hurr'));
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki