Re: NULLS vs Empty result in PHP

From: Date: Wed, 23 Sep 2009 14:48:47 +0000
Subject: Re: NULLS vs Empty result in PHP
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-298285@lists.php.net to get a copy of this message
> > From reading the other responses to this thread, it seems that you want > to > "skip" or "exclude" rows in the results where my_column === null. > > If this is correct, why not do it in the SELECT statement to begin with? > > $my_query = "SELECT my_column FROM my_database WHERE my_column IS NOT > NULL"; > > That should do it. > I want to exclude the rows that might be NULL, "" (empty), or " " (empty series of spaces) From all of the input so far, it seems that using trim() on the variable and then use empty() is the best way to pick all three types up.

« previous php.general (#298285) next »