List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:August 25 1999 6:54pm
Subject:Re: Semantics of LAST_INSERT_ID()...
View as plain text  
At 11:23 AM -0700 8/25/99, Jon Frisby wrote:
>I need to know the semantics of LAST_INSERT_ID()...  Does it return the last
>ID inserted on this connection, or the last ID inserted period.

On the connection, as the manual says.

>Specifically, if I do an insert, and then SELECT LAST_INSERT_ID() to get the
>ID generated by the insert, does this create a potential race hazard?  Is it
>safer to use $sth->{insertid} instead?  (I'm guessing that would be faster?)

No race condition.

Paul DuBois, paul@stripped
Semantics of LAST_INSERT_ID()...Jon Frisby25 Aug
  • Re: Semantics of LAST_INSERT_ID()...Paul DuBois25 Aug