RE: [PEAR] Problem with DB::autoExecute() and NULL
| From: | Sönke Ruempler | Date: | Thu, 07 Oct 2004 09:10:05 +0000 |
| Subject: | RE: [PEAR] Problem with DB::autoExecute() and NULL | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14787@lists.php.net to get a copy of this message | ||
Andreas Korthaus <mailto:akorthaus@web.de> wrote on
Thursday, October 07,
2004 10:55 AM:
> If $_SESSION['id'], $_SESSION['data'], $_SESSION['number']
> contain any
> value, there is no problem. But sometimes, for example
> $_SESSION['number'] is not set (NULL), so I would like to get 0 or ''
> into the
> database, or do
> not set this field, but DB::autoExecute() does the following:
>
> INSERT INTO data
> (id,title,data,number)
> VALUES
> (123,'my data',NULL);
It's a feature. But you code is unclean if you try to call undefined
variables. So maybe you want to enable E_NOTICE errors in you test
enviroment and check were your code is unclean.