I am making a registration form with an SQL INSERT query using PDO. After this INSERT, I want to extract only userid (automatically incrementing, primary key) and INSERT into another table (table "verification code")
But how can I make sure that this user ID does not belong to the second user who registered 1 / 1000th of a second later than the first user?
Should I find a way to lock the table? Should I use transactions?
php mysql pdo
alexx0186
source share