Re: Re: How to output a NULL field?
| From: | Bastien Koert | Date: | Wed, 26 Aug 2009 18:02:22 +0000 |
| Subject: | Re: Re: How to output a NULL field? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-297319@lists.php.net to get a copy of this message | ||
On Wed, Aug 26, 2009 at 12:06 PM, Andrew Ballard<aballard@gmail.com> wrote:
> On Tue, Aug 25, 2009 at 3:22 PM, Shawn McKenzie<nospam@mckenzies.net> wrote:
>> First off, if the value is NULL in the database then in PHP it will be
>> the string "NULL" and not a null value as far as I remember.
>
> I've not seen this happen. I've found, depending on the database and
> the data access library used to interface with it that NULL usually
> comes back as either the PHP NULL value or an empty string.
>
> Andrew
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
One option then, might be to format the result with SQL using a CASE
WHEN THEN statement or ISNULL / IFNULL to set it to empty string
--
Bastien
Cat, the other other white meat