|
Posted by Andy Hassall on 12/21/05 19:08
On Wed, 21 Dec 2005 08:07:08 -0800, "Connector5" <junkmilenko@charter.net>
wrote:
>Warning when pulling last_insert_ids:
>
>In a high-traffic server, last_insert_id could actually return a false
>result if two records are inserted at near the same time. Since queries are
>queued in order of request, you will definitely get overlap some day.
But mysql_insert_id() is connection-specific, and PHP won't share a connection
within a request, even with persistent connections, so how can this occur? Are
you sure it's not some other factor?
http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html
http://dev.mysql.com/doc/refman/5.0/en/mysql-insert-id.html
"The value of mysql_insert_id() is affected only by statements issued within
the current client connection. It is not affected by statements issued by other
clients."
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|