php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40974 whoops
Submitted: 2007-04-01 18:31 UTC Modified: 2007-04-01 18:35 UTC
From: justin dot hendrickson+pecl at gmail dot com Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.2.1 OS: Ubuntu 6.10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: justin dot hendrickson+pecl at gmail dot com
New email:
PHP Version: OS:

 

 [2007-04-01 18:31 UTC] justin dot hendrickson+pecl at gmail dot com
Description:
------------
Using PDO::PARAM_NULL when doing a bindParam()/bindValue() does not insert a NULL value. It appears to insert the default value instead. '' in (var)char/text fields, 0 in boolean fields, ect.

Reproduce code:
---------------
$stmt = 'INSERT INTO table (field) VALUES (:placeholder)';
$stmt->bindValue(':placeholder', PDO::PARAM_NULL);
$stmt->execute();

Expected result:
----------------
`field` in `table` set to NULL

Actual result:
--------------
`field` in `table` set to default value

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-01 18:35 UTC] justin dot hendrickson+pecl at gmail dot com
PEBKAC
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Mar 04 05:01:24 2021 UTC