How safe is it to use the following script. For example, a user fills out a form with all the registration information and some of the info on that form goes to the User table and some of the other info goes into another Table, say, Billing. I run the query that inserts the user into the User table, then right away I want to check for the last person that registered and add the billing info to that table. However, what if 2 people submit information at the same time? Would MySQL get confused? If so, what is a good way around this?
if (mysql_insert_id() != 0)
{
$inserted_id = mysql_insert_id();
}