How to get the ID of the last insert.

Posted by James Jeffery on Stack Overflow See other posts from Stack Overflow or by James Jeffery
Published on 2010-06-08T23:20:22Z Indexed on 2010/06/08 23:22 UTC
Read the original article Hit count: 147

Filed under:

I have an application and around 20 accounts are created per minute (on average). I need to implement a new feature which requires the ID of the last insert.

I am using PDO.

The question is, lets say 5 users create accounts at exactly the same time. Will it return the ID from the database for that users profile that was just created, or will it return the last insert?

If you get what I mean.

© Stack Overflow or respective owner

Related posts about php