note 123467 added to pdo.lastinsertid

From: Date: Tue, 25 Dec 2018 07:06:53 +0000
Subject: note 123467 added to pdo.lastinsertid
Groups: php.notes 
Request: Send a blank email to php-notes+get-209948@lists.php.net to get a copy of this message
$dbh->commit(); print $dbh->lastInsertId(); The above will always return zero (0) So it is important to call $dbh->lastInsertId(); before commiting transaction the above should be modified as print $dbh->lastInsertId(); $dbh->commit(); ---- Server IP: 208.43.231.9 Probable Submitter: 2a01:4a0:38:1::3 (proxied: 193.188.118.18) ---- Manual Page -- http://php.net/manual/en/pdo.lastinsertid.php Edit -- https://master.php.net/note/edit/123467 Del: integrated -- https://master.php.net/note/delete/123467/integrated Del: useless -- https://master.php.net/note/delete/123467/useless Del: bad code -- https://master.php.net/note/delete/123467/bad+code Del: spam -- https://master.php.net/note/delete/123467/spam Del: non-english -- https://master.php.net/note/delete/123467/non-english Del: in docs -- https://master.php.net/note/delete/123467/in+docs Del: other reasons-- https://master.php.net/note/delete/123467 Reject -- https://master.php.net/note/reject/123467 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#209948) next »