List:General Discussion« Previous MessageNext Message »
From:Johan De Meersman Date:February 17 2009 9:53am
Subject:Re: how to check for null in string
View as plain text  
In SQL, the correct syntax is "IS NULL" or "IS NOT NULL".

Random programming languages more often than not have no decent support for
NULL content, although your DB library might have an isnull() function or
something similar. Once you've exported a field into a regular variable,
however, most often NULL becomes indistinguishable from an emtpy string.


On Tue, Feb 17, 2009 at 2:47 AM, PJ <af.gourmet@stripped> wrote:

> I know this is not working, but how can I check for NULL; or how can I
> configure my field "sub_title" so I can check if $booksub_title contains
> anything or is empty.
> This problem as been breaking my back...don't know what to put in as a
> default to be able to check against string input (VARCHAR) or should I
> use another type?
>
> if ($booksub_title != NULL) {
>        echo "<td width='400'><b>$booktitle[$i]</b><br>
> $booksub_title[$i]</b>";
>            }
>        else {echo "<td width='400'><b>$booktitle[$i]</b>";
>            }
>
> --
>
> Phil Jourdan --- pj@stripped
>   http://www.ptahhotep.com
>   http://www.chiccantine.com
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
>


-- 
Celsius is based on water temperature.
Fahrenheit is based on alcohol temperature.
Ergo, Fahrenheit is better than Celsius. QED.

Thread
how to check for null in stringPJ17 Feb
  • Re: how to check for null in stringJohan De Meersman17 Feb
    • Re: how to check for null in stringJoerg Bruehe17 Feb
    • Re: how to check for null in stringPJ17 Feb