Re: Re: NULLS vs Empty result in PHP
| From: | Dan Shirah | Date: | Wed, 23 Sep 2009 13:01:08 +0000 |
| Subject: | Re: Re: NULLS vs Empty result in PHP | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-298273@lists.php.net to get a copy of this message | ||
>
> using empty() is ´the right way to check a var for NULL or ""
>
> however, it also depends what MySQL has got as setuo definition for empty
> fields. on textfields u can define an epmty string as default.
>
> So say these are the first three results of my query:
"some text" //The column actually has data
" " //The column contains a series of spaces
"NULL" //The column contains a NULL value
As long as I trim() the result, if (!empty()) would skip any results where
the column contains " " OR "NULL", correct?