João Mosmann
João Mosmann

Reputation: 2902

Zend Framework DB Complex Where Or condition

How can I do a SELECT like this using Zend Framework Table.

SELECT * FROM table WHERE (field1 = 0 AND field2 = 1) OR (field2 = 0 AND field3 = 1)

Using just $table->orWhere() dont allow me to do multiple conditions inside of a parentheses

Upvotes: 3

Views: 1187

Answers (1)

Zachary Schuessler
Zachary Schuessler

Reputation: 3682

To build complex queries:

// Zend_Db_Table
$this->getAdapter()->quoteInto('(field1 = 1 AND field2 =2) OR ...');

Here is a comprehensive article for more information.

Upvotes: 2

Related Questions