Re: [PHP] Re: How to output a NULL field?

2009-08-27 Thread Martin Scotta
l@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

RE: [PHP] Re: How to output a NULL field?

2009-08-27 Thread David Stoltz
You're a genius - that works! -Original Message- From: Bastien Koert [mailto:phps...@gmail.com] Sent: Wednesday, August 26, 2009 2:02 PM To: Andrew Ballard Cc: Shawn McKenzie; php-general@lists.php.net; David Stoltz Subject: Re: [PHP] Re: How to output a NULL field? One o

Re: [PHP] Re: How to output a NULL field?

2009-08-26 Thread Bastien Koert
On Wed, Aug 26, 2009 at 12:06 PM, Andrew Ballard wrote: > On Tue, Aug 25, 2009 at 3:22 PM, Shawn McKenzie 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, depen

Re: [PHP] Re: How to output a NULL field?

2009-08-26 Thread Andrew Ballard
On Tue, Aug 25, 2009 at 3:22 PM, Shawn McKenzie 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 interf

[PHP] Re: How to output a NULL field?

2009-08-25 Thread Shawn McKenzie
Shawn McKenzie 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. Second, > you cant use a function/method in empty(). Thirdly, the string "NULL" > is not empty. I'm not sure what DB class you're using h

[PHP] Re: How to output a NULL field?

2009-08-25 Thread Shawn McKenzie
David Stoltz wrote: > $rs->Fields(22) equals a NULL in the database > > My Code: > > if(empty($rs->Fields(22))){ > $q4 = ""; > }else{ > $q4 = $rs->Fields(22); > } > > Produces this error: > Fatal error: Can't use method return value in write context in > D:\Inetpub\wwwroot\evaluation