|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67557 PHP PDO insert using transaction doesn't show error
Submitted: 2014-07-03 03:13 UTC Modified: 2014-10-31 18:26 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: marcio at evomaster dot com dot br Assigned: mbeccati (profile)
Status: Not a bug Package: PDO PgSQL
PHP Version: 5.5.14 OS: CentOS 6.5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
17 + 4 = ?
Subscribe to this entry?

 [2014-07-03 03:13 UTC] marcio at evomaster dot com dot br
From manual page:

$Pdo = new PDO('pgsql:host=localhost;port=5432;dbname=mydb', 'user', 'password');

$options = = array(

$sql = 'INSERT INTO my_table (
        ) VALUES (


$Ps = $Pdo->prepare($sql, $options);

    ':field_a' => 'Field A',
    ':field_b' => 'Field B',
    ':field_c' => 'Field C'


Test script:
$Ps-execute() returns false, but doesn't show an error message telling that there are more columns than in the SQL specified.

In my real case i have more than one SQL statement, because of this i am using a transaction.

Expected result:
I expect that PHP throw an exception or error

Actual result:
PHP didn't trigger exception or error and proceed with the code


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-03 12:46 UTC] marcio at evomaster dot com dot br
I forgot to say that is very critical the fact of $Pdo->commit() returns true, even with the $Ps->execute() failure.
 [2014-10-31 18:26 UTC]
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: mbeccati
 [2014-10-31 18:26 UTC]
Thanks for the bug report. I'm afraid I can't reproduce the bug.

I get:

Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: :field_c'
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 22 04:01:29 2024 UTC