I have a registration page which then inserts data into two tables in MySQL. The first one is technical information like username/password/email, and the other one is for personal information like name/address and such.
My technical information table has a primary key auto incremental ID, and then, once I create the row in this table, I immediately create another row in the general information table with the same id.
To obtain that ID, I use the mysql_insert_id()
function right after the first insert query.
My question is rather general: can you really trust this function that it will necessarily return the appropriate index? What if I had a website with many users registering every second, would it still be reliable, and always return the ID? Or does it just return the last primary key of a table generated?