0

Could someone please tell me the correct syntax for a Zend DB query to represent the last line (the 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(...)
Jarrod
  • 9,349
  • 5
  • 58
  • 73

2 Answers2

3

This seemed logical and worked. So Yay.

->where('id = ?', 1241487470)
->where('contract= ? or is_work IS NOT NULL)
Jarrod
  • 9,349
  • 5
  • 58
  • 73
2

This seems works too and preserve zend db escapement

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