|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58044 lastInsertId
Submitted: 2008-02-18 07:08 UTC Modified: 2009-03-06 02:39 UTC
From: yetos at seznam dot cz Assigned:
Status: Closed Package: PDO_INFORMIX (PECL)
PHP Version: 5.1.6 OS: RHEL 5.1
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.
Block user comment
Status: Assign to:
Bug Type:
From: yetos at seznam dot cz
New email:
PHP Version: OS:


 [2008-02-18 07:08 UTC] yetos at seznam dot cz
lastInsertId always return 0 after call exec("INSERT ...")

Reproduce code:
When using

$dbh->exec("INSERT INTO ... ");
$dbh->lastInsertId();   //return always 0
// + good Error Info for any error (268, 691, ...)

when using

$stmt = $dbh->prepare("INSERT INTO ... ");
$dbh->lastInsertId();   //this work OK  
// + bad Error Info for error , how reported in bug#13115


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-11 11:52 UTC] opendev at us dot ibm dot com
An internal defect is opened to track this problem.
 [2009-03-06 02:39 UTC] abhargav at in dot ibm dot com
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 13:01:29 2024 UTC