php.net |  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
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:
MUST BE VALID
Solve the problem:
39 - 30 = ?
Subscribe to this entry?

 
 [2008-02-18 07:08 UTC] yetos at seznam dot cz
Description:
------------
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 ... ");
$stmt->execute();
$dbh->lastInsertId();   //this work OK  
// + bad Error Info for error , how reported in bug#13115


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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
http://pecl.php.net/get/PDO_INFORMIX


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 10:01:29 2024 UTC