0

有人可以告诉我 Zend DB 查询表示最后一行的正确语法(and (xxx or xxx)

...
where
    id = 1241487470
and (contract=0 or is_work IS NOT NULL)
...

我被困在这个:

->where('id = ?', 1241487470)
->where(...)
4

2 回答 2

3

这似乎合乎逻辑并且有效。所以耶。

->where('id = ?', 1241487470)
->where('contract= ? or is_work IS NOT NULL)
于 2012-07-05T04:19:22.177 回答
2

这似乎也有效并保留了zend db擒纵机构

->where('id = ?', 1241487470);
->where('(contract = ?', 0);
->orWhere('is_work IS NOT NULL)');
于 2014-07-03T09:22:55.560 回答