How to select rows where column value IS NOT NULL using CodeIgniter's ActiveRecord?

前端 未结 10 1798
太阳男子
太阳男子 2020-12-04 17:15

I\'m using CodeIgniter\'s Active Record class to query the MySQL database. I need to select the rows in a table where a field is not set to NULL:

$this->d         


        
10条回答
  •  北海茫月
    2020-12-04 18:00

    Much better to use following:

    For is not null:

    where('archived IS NOT NULL', null);
    

    For is null:

    where('archived', null);
    

提交回复
热议问题