Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to write: WHERE [field] IS NULL #153

Open
dreammonkey opened this issue Jul 6, 2016 · 2 comments
Open

How to write: WHERE [field] IS NULL #153

dreammonkey opened this issue Jul 6, 2016 · 2 comments

Comments

@dreammonkey
Copy link

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');

@salain
Copy link
Collaborator

salain commented Jul 6, 2016

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();

@nuryagdym
Copy link

it causing serious problem, and generated headaches to me
described here #295

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants