Re: Update or insert NULL values ( DB_DataObject )
| From: | Alan Knowles | Date: | Tue, 23 Dec 2003 12:50:12 +0000 |
| Subject: | Re: Update or insert NULL values ( DB_DataObject ) | ||
| References: | 1 | Groups: | php.pear.general php.pear.general |
| Request: | Send a blank email to pear-general+get-9799@lists.php.net to get a copy of this message | ||
I'd probably stick to using plain 'null' as a string. - you could do is_a($do->value,'DB_DataObject_Cast') && $do->value->value == 'null'
but its even messier than the string version of null.
Regards
Alan
Marcos Neves wrote:
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.comThank's, works fine, but... There's an reverse for DB_DataObject_Cast ? I need to do this: $do->field = DB_DataObject_Cast::sql('null'); $do->update or insert ... echo $do->field; // give me Object, I want null like if($do->field == null){ ... maybe using an overload getField but what I should write on it? or any other idea!? At 09:22 20/12/2003 +0800, you wrote:use $do->field = 'null'; or // for any raw sql. $do->field = DB_DataObject_Cast::sql('null'); null as a native value in PHP doesnt really exist, - it's very close unset(), and very difficult to test for reliably.. Regards Alan Marcos Neves wrote:I'm not able to insert or update NULL values to database using DB_DataObject. any idea? or a bug?-- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php