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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-01 18:35 UTC] justin dot hendrickson+pecl at gmail dot com
PEBKAC
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 08:01:29 2025 UTC