Re: syntax question
| From: | Chris Shiflett | Date: | Mon, 30 Sep 2002 05:29:45 +0000 |
| Subject: | Re: syntax question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118145@lists.php.net to get a copy of this message | ||
Justin French wrote:
on 30/09/02 2:44 PM, Jeff Bluemel (jeff@domintcom.com) wrote:I think he maybe meant testing for null values in SQL. If this is true, there is the null keyword: "is null" and "is not null". select * from table_name where column_name is not null This selects all rows from a table where the data in column column_name is not null. Be careful with this, as it actually tests for null and not an empty string, for example. If you want to test whether a value is null once you have assigned it to a PHP variable, you can use one of Justin's suggestions. In addition, PHP has null as well. Happy hacking. Chrishow to I test for a null value?empty()? isset()? if($var == "")? if($var == "NULL")?? have a look in the php manual for string functions, and comparison operators