when you see the documentation you can use $this->db->where() with the third parameter set to FALSE so as not to escape your request. Example:
$this->db->where('field is NOT NULL', NULL, FALSE);
Or you can use a custom query string like this
$where = "field is NOT NULL"; $this->db->where($where);
So your query builder will look like this:
$this->db->select('*'); $this->db->where('field is NOT NULL', NULL, FALSE); $this->db->get('donors');
OR
$this->db->select('*'); $where = "field is NOT NULL"; $this->db->where($where); $this->db->get('donors');
source share