note 56812 deleted from function.is-null by danbrown
| From: | danbrown@php.net | Date: | Mon, 15 Jun 2009 12:20:44 +0000 |
| Subject: | note 56812 deleted from function.is-null by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-156878@lists.php.net to get a copy of this message | ||
Note Submitter: jacob at gnu dot org
----
The notes from the other users are confusing on what happens when a value from a mysql query is NULL
(SQL NULL). After doing a few tests, it looks like the way to test if the value is NULL or not is
to use is_null($whatever)
also, it looks like this is functionally the same as (! isset($whatever) )
when you set $whatever =NULL, isset($whatever) returns false now...
is ! isset($whatever) == is_null($whatever) for all versions of php?
btw, the reason why people want to check for the NULL in the application is when they use a query
that returns multiple rows of multiple columns where some columns are NULL is some rows, but not
others and they don't want to have multiple SELECT queries for each possible outcome.