简体   繁体   English

Zend DB-位置和/或查询

[英]Zend DB - where And Or Query

Could someone please tell me the correct syntax for a Zend DB query to represent the last line (the and (xxx or xxx) 有人可以告诉我Zend DB查询代表最后一行的正确语法( and (xxx or xxx)

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

I'm stuck at this: 我被困在这里:

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

This seemed logical and worked. 这似乎合乎逻辑且可行。 So Yay. 好耶

->where('id = ?', 1241487470)
->where('contract= ? or is_work IS NOT NULL)

This seems works too and preserve zend db escapement 这似乎也可以工作并保留zend db擒纵系统

->where('id = ?', 1241487470);
->where('(contract = ?', 0);
->orWhere('is_work IS NOT NULL)');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM