List:General Discussion« Previous MessageNext Message »
From:Michael Dykman Date:May 30 2008 1:38pm
Subject:Re: Obtaining AUTOINCREMENT of just inserted record, but...
View as plain text  
I'm not clear what you mean when you distinguish between JUST inserted
and LAST inserted.  In any case, the only mechanism available is
SELECT LAST_INSERT_ID().  MySQL does have a concept of sessions, so if
2 users are submitting at the same moment, that database activity
would be occurring across two distinct connections and the result of
the call would reflect the last insert on that same connection.  It's
perfectly safe and will give you the value that you are looking for.
(If it didn't, ~70% of the apps on the web would be irretrievably
broken).

 - michael dykman

On Fri, May 30, 2008 at 9:27 AM, Miguel Cardenas <renito73@stripped> wrote:
> Hello list
>
> I need to retrieve the AUTOINCREMENT field from the just inserted record,
> note that I say JUST INSERTED and not LAST INSERTED.
>
> It is for a website that accepts forms submitted by users, but it may occur
> in some time that two or more forms are submitted simultaneously by
> different users, so not necessarily the last inserted could be the just
> inserted, or yes?
>
>
> Thanks for any help
>



-- 
 - michael dykman
 - mdykman@stripped

 - All models are wrong. Some models are useful.
Thread
Obtaining AUTOINCREMENT of just inserted record, but...Miguel Cardenas30 May
  • Re: Obtaining AUTOINCREMENT of just inserted record, but...Michael Dykman30 May
    • Re: Obtaining AUTOINCREMENT of just inserted record, but...D Hill30 May
    • Re: Obtaining AUTOINCREMENT of just inserted record, but...D Hill30 May
      • Re: Obtaining AUTOINCREMENT of just inserted record, but...Moon's Father2 Jun
  • Re: Obtaining AUTOINCREMENT of just inserted record, but...Ben Clewett30 May
    • Re: Obtaining AUTOINCREMENT of just inserted record, but...Werner Van Belle30 May