MySQL Forums
Forum List  »  Perl

Re: retrieve auto-increment value
Posted by: Randy Clamons
Date: May 26, 2009 11:10AM

You can't make both select in a single call. AFter you insert the row, make a second call to select the LAST_INSERT_ID(). Be sure not to close your connection before making the second call. LAST_INSERT_ID() is thread safe, so you won't get another user's value.

Options: ReplyQuote


Subject
Written By
Posted
Re: retrieve auto-increment value
May 26, 2009 11:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.