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

Phalcon model FindFirst on NULL values

Hi all,

My question is here: StackOverflow.

Basically, this does not work:

$model = MyModel::findFirst([
    'conditions' => 'field=?0',
    'bind' => [
        0 => null,
    ],
    'bindTypes' => [
        0 => Phalcon\Db\Column::BIND_PARAM_NULL,
    ]
]);

What am I doing wrong there?

Cheers!



51.3k

Well, apart from doing 'conditions' => 'field IS NULL',

edited Aug '20

I've never done this sort of thing - but your second comment seems like it should work, no?

What does the query look like on the server's side?