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.