NULL values with WHERE method
NULL values with WHERE method
Wakaru
Posts: 13Questions: 5Answers: 0
Hi,
I'm trying to use where -method to match NULL -values from the column named 'COMMENT'. What is the proper syntax for this operation (or is there one)?
I have tried several ways of doing this but can't get it to work. Here's one example:
$editor->where( $key = 'COMMENT', $value = '', $op = 'IS NULL' );
Thanks!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi,
I don't think there is a proper way of doing this with the libraries at the moment I'm afraid. Let me look into it and I'll get back to you, but I suspect it will need the updates I'm planning for 1.4...
Allan
Hi,
I've just implemented this for the 1.4 release but it does require an update to the PHP libraries - if you'd like me to send over a copy of the current dev files, just let me know and I'll e0mail them through to the address for your account.
With the new libraries what you can do is use the second parameter (the value) as
null
to match on null:Which is identical to:
(i.e.
COMMENT = null
- the database abstraction will convert that to beIS NULL
).Likewise for
IS NOT NULL
you would do:Allan
Thanks, it would be great to have those files.
E-mail sent :-)
Allan