I have little confusion about the Php PDO function: lastInsertID. If I understand correctly, it returns the last auto-incremental id that was inserted in the database.

I usually use this function when I execute a query that inserts a user in my database when I am creating the functionality of registering a user.

My question is that say I have a hundred people registering on my site at one point for example. And may be one user hit the 'Register' button a millisecond after another user. Then is there a chance that this function lastInsertId will return the id of another user that register just momentarily earlier?

May be what I am trying to ask is does the server handle one request at a time and go through a php file one at a time?

Please let me know about this.

Thank you.

Edit
Report