2

I am new to zf and I've started working with zf2, I don't find much documentation for the syntax and all. My issue is how to write is not null condition in zf2 syntax.

$select->where->notEqualTo('pe_name', '');

I've written for not equal to, now I need for is not null. I don't know how to write this in this syntax. Can anyone who is familiar with this help me.

kumar
  • 1,796
  • 2
  • 15
  • 37
  • 1
    You could directly specify `->where('something IS NOT NULL')`. Also have a look [here](http://framework.zend.com/apidoc/2.1/classes/Zend.Db.Sql.Where.html#isNotNull). – Andrei May 29 '15 at 15:05
  • possible duplicate of ["IS NULL" in Zend\_Db\_Table select not working](http://stackoverflow.com/questions/2417739/is-null-in-zend-db-table-select-not-working) – Chris Stillwell May 29 '15 at 15:05

1 Answers1

17

got it..!!

$select->where->isNotNull('pe_name');

and

$select->where('pe_name IS NOT NULL');

also works.

kumar
  • 1,796
  • 2
  • 15
  • 37