note 102299 added to mysqli-stmt.insert-id
| From: | hgernhardt at tcnewengland dot org | Date: | Mon, 07 Feb 2011 15:33:40 +0000 |
| Subject: | note 102299 added to mysqli-stmt.insert-id | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176743@lists.php.net to get a copy of this message | ||
It should be noted that using mysqli_stmt->insert_id will not result in a unique ID being
returned for each execution of a prepared insert statement. In practice, it appears that the first
insertion ID is returned. If you are performing multiple inserts with the same prepared statement
(one invocation of mysqli_stmt::prepare and multiple invocations of mysqli_stmt::execute() for a
given statement), and need to keep the unique ID for each insert, use
mysqli_connection->insert_id.
----
Server IP: 69.147.83.197
Probable Submitter: 75.146.5.67 (proxied: 127.0.0.1)
----
Manual Page -- http://www.php.net/manual/en/mysqli-stmt.insert-id.php
Edit -- https://master.php.net/note/edit/102299
Del: integrated -- https://master.php.net/note/delete/102299/integrated
Del: useless -- https://master.php.net/note/delete/102299/useless
Del: bad code -- https://master.php.net/note/delete/102299/bad+code
Del: spam -- https://master.php.net/note/delete/102299/spam
Del: non-english -- https://master.php.net/note/delete/102299/non-english
Del: in docs -- https://master.php.net/note/delete/102299/in+docs
Del: other reasons-- https://master.php.net/note/delete/102299
Reject -- https://master.php.net/note/reject/102299
Search -- https://master.php.net/manage/user-notes.php