We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to use "where"-clause for an empty record ?

Hi,

I try to do something like that Model::find(["field = 'NULL'"]);

=> Should return all records where that field is NULL

But there´s no return. I tried several ways but there´s nothing ? Is there another way, that i missed in the docs ??

Thanks



98.9k
Accepted
answer

Try:

Model::find(["field IS NULL"]);

Hack ... that´s it !

Thanks so much ;)