|
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]
|