|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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-2022 The PHP Group
All rights reserved.
Last updated: Thu Jan 20 10:03:34 2022 UTC