You are here: Re: last inser id query « PHP Language « IT news, forums, messages
Re: last inser id query

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация