Re: DB_DataObject and NULL values
| From: | Alan Knowles | Date: | Wed, 02 Jul 2003 01:04:54 +0000 |
| Subject: | Re: DB_DataObject and NULL values | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17921@lists.php.net to get a copy of this message | ||
Arnaud Limbourg wrote:
Actually the design was correct, it was supposed to use null as a php value. - it looks like I need to use @is_null($value); tests as isset() return false on null.. Will have a look at it later today hopefully Regards Alanhey I've come across a little problem while trying to update a row in the database with a NULL value. what I'm trying to do is basically this: $dbObject->Col1 = null; $dbObject->Col2 = null; $dbObject->update();The thing is that you are passing the PHP NULL type. What you probably want to do here is $dbObject->Col1 = 'null'; $dbObject->Col2 = 'null'; $dbObject->update(); thus passing a string which the database will interpret in the correct way. Arnaud.
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com