Re: NULL / blank string ?
| From: | Matt Friedman | Date: | Mon, 15 Oct 2001 04:25:44 +0000 |
| Subject: | Re: NULL / blank string ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71052@lists.php.net to get a copy of this message | ||
You could use IS NULL in your sql to determine that info at that point.
However, I believe that php will interpret an empty string and a null as
boolean false.
So all you really have to do is:
if( !$var )
{
// do something...
}
(In your post I think you used "&" instead of "$" unless you meant something
else. )
Matt Friedman.
----- Original Message -----
From: "Manisha" <manisha@aurica.com>
To: <php-general@lists.php.net>
Sent: Sunday, October 14, 2001 9:52 PM
Subject: [PHP] NULL / blank string ?
> How to detect a NULL or blank string fetched from database ? I am using
>
> if (&var != "") { do someting .....}
>
> Is it sufficient ?
>
> manisha
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>