Reply to Re: getting ID field (autoinc)

Your name:

Reply:


Posted by Andy Jeffries on 09/28/25 11:33

On Fri, 02 Dec 2005 10:01:11 -0600, Khai wrote:
> Is it possible to do the Insert, then an immediate select of the ID?
>
> My theory is - what happens if John Doe is inserted at the same time Jane
> Dew is inserted? Will the script running for John have any chance of
> picking the id up of Jane?

Sorry, I gave the code and missed the question.

No there's no way as you won't be sharing a connection to the MySQL server
and the LAST_INSERT_ID() MySQL function (or PHP function) returns the last
ID created for an insert on this connection.

No chance of cross-confusion, it'll work perfectly.

Cheers,


Andy


--
Andy Jeffries | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos

[Back to original 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

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