CodeIgniter-MY_Model
CodeIgniter-MY_Model copied to clipboard
How to write: WHERE [field] IS NULL
Works: $this->db->where('field IS NULL'); $result = $this->get_all();
DOES NOT WORK: $result = $this->where('field', NULL)->get_all(); $result = $this->where('field is', NULL)->get_all(); $result = $this->where('field IS NULL')->get_all(); $result = $this->get_all('field is null');
You need to make the where clause a custom string like this:
$result = $this->where('fieldName IS NULL',NULL,NULL,FALSE,FALSE,TRUE)->get_all();
it causing serious problem, and generated headaches to me described here #295