Re: DB, prepare() and NULL values

From: Date: Mon, 03 Apr 2006 17:53:41 +0000
Subject: Re: DB, prepare() and NULL values
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23521@lists.php.net to get a copy of this message
Justin Patrin wrote:
On 4/3/06, Justin Patrin <papercrane@gmail.com> wrote:
On 4/3/06, Chris Boget <chris.boget@wild.net> wrote:
All morning I've been trying to somehow work it so that prepare() recognizes and accounts for NULL values. Such that if I set a variable as NULL and NULL being a valid value for a field in the table, it would prepare the query so that it generates it using NULL.
<snip>
So I'm curious, is what I am trying to do even possible? I've looked at the source code in DB_common and it appears that I'm SOL. Has anyone else had any success in doing what I'm trying to do?
As a workaround....try not preparing fields which need to be set to NULL perhaps?
Oh, and I also suggest looking into MDB2, perhaps it can do what you want.
MDB2 should work just fine. There is even a test in the testsuite for this. But I am suprised that DB is having issues there. Might be some side effect of setting or unsetting some portability mode. regards, Lukas

« previous php.pear.general (#23521) next »