RE: [PHP] last_insert_id function
| From: | Don Read | Date: | Wed, 24 Jan 2001 18:09:34 +0000 |
| Subject: | RE: [PHP] last_insert_id function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-36444@lists.php.net to get a copy of this message | ||
On 24-Jan-01 Mark Lipscombe wrote:
> Someone jump in here and correct me if I'm wrong, but by the time you
> get around to executing the second query, LAST_INSERT_ID() from MySQL
> isn't necessarily going to be the desired value, because another record
> may well have been inserted in that time?
You're wrong; from the manual:
" ...
The last ID that was generated is maintained in the server on a
per-connection basis. It will not be changed by another client.
"
Regards,
--
Don Read dread@texas.net
-- The problem with people who have no vices is that you can be
sure they're going to have some pretty annoying virtues.