note 83515 deleted from function.mysql-insert-id by felipe
| From: | felipe@php.net | Date: | Thu, 29 May 2008 13:44:27 +0000 |
| Subject: | note 83515 deleted from function.mysql-insert-id by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-139982@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
You cannot use a query to get "the next autoincrement value" (read: it is fundamentally
impossible) because it will break if you have multiple processes updating your db.
Trivally proven by the following scenario:
* Query to get 'next autoincrement value'
* Another process drops a new row in the DB and autoincrements *again*
* Conflict