From: Bastien Koert on
On Wed, Aug 26, 2009 at 12:06 PM, Andrew Ballard<aballard(a)gmail.com> wrote:
> On Tue, Aug 25, 2009 at 3:22 PM, Shawn McKenzie<nospam(a)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
From: Paul M Foster on
On Wed, Aug 26, 2009 at 12:48:12PM -0400, David Stoltz wrote:

> Looking on Amazon and other book sites, I can't even find a book for
> "PHP and MS SQL"...
>
> It's all "PHP and MySQL"...
>
> Should I avoid developing PHP application with MS SQL databases?

My *opinion* is that you should avoid Microsoft products whenever
possible. BTW, you can also find books on PHP and PostgreSQL, which,
also in my *opinion* is a superior choice over MySQL.

Paul

--
Paul M. Foster
From: "David Stoltz" on
You're a genius - that works!!!!!


-----Original Message-----
From: Bastien Koert [mailto:phpster(a)gmail.com]
Sent: Wednesday, August 26, 2009 2:02 PM
To: Andrew Ballard
Cc: Shawn McKenzie; php-general(a)lists.php.net; David Stoltz
Subject: Re: [PHP] Re: How to output a NULL field?


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
From: Martin Scotta on
On Thu, Aug 27, 2009 at 9:37 AM, David Stoltz <Dstoltz(a)shh.org> wrote:

> You're a genius - that works!!!!!
>
>
> -----Original Message-----
> From: Bastien Koert [mailto:phpster(a)gmail.com]
> Sent: Wednesday, August 26, 2009 2:02 PM
> To: Andrew Ballard
> Cc: Shawn McKenzie; php-general(a)lists.php.net; David Stoltz
> Subject: Re: [PHP] Re: How to output a NULL field?
>
>
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Let me do this simple question... is your Sql Server legal? Then use it.

If not, why don't you migrate to an open source alternative? there are a lot
of DB you can use, and if you use an open source alternative then it's
legal, that's mean you, or your client, do not have to pay for use it.

I'm not going to say *that* DB is better that *this* other, this is a matter
of taste.

--
Martin Scotta