Re: autoexecute and NULL values
| From: | Kevin McCarthy | Date: | Wed, 23 May 2007 01:23:55 +0000 |
| Subject: | Re: autoexecute and NULL values | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-27354@lists.php.net to get a copy of this message | ||
Thanks for the response, turns out to be a simple matter that I figured out
myself.
As I'm using PHP, I only need to indicate the value is that of the constant
NULL. By empty I meant 'no value' rather than NULL. The fields I am
accessing require an integer or a NULL value and an empty value will not
suffice.
On 5/21/07, Justin Patrin <papercrane@gmail.com> wrote:
On 5/21/07, Kevin McCarthy <kemccarthy1@gmail.com> wrote: In learning to PEAR DB, I am stumped on how to use autoExecute() for INSERT or UPDATE when some fields should be set as NULL in the database record. If I leave the field empty, this does not translate to NULL in the actual query generated yielding an error when a value is expected. What do you mean by empty and what is the generated query? I could simply check each field set in the autoExecute() fields array before including it but I'd expect that there is a more elegant solution. Perhaps you should include a few lines of code to show us what you're doing and what you expect. -- Justin Patrin-- Kevin McCarthy kemccarthy1@gmail.com