How safe is Php PDO function: lastInsertId? -


i have little confusion php pdo function: lastinsertid. if understand correctly, returns last auto-incremental id inserted in database.

i use function when execute query inserts user in database when creating functionality of registering user.

my question have hundred people registering on site @ 1 point example. , may 1 user hit 'register' button millisecond after user. there chance function lastinsertid return id of user register momentarily earlier?

may trying ask server handle 1 request @ time , go through php file 1 @ time?

please let me know this.

thank you.

perfectly safe. there no race condition. returns last inserted id pdo object made insert.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -