I am writing data to a MySQL database. I then immediatly return the ID of that entry to the user using mysql_insert_id:
$query = "INSERT INTO pet VALUES ('id','$petfirst','$petmiddle','$petlast','$petsuffix','$petstreet','$petstreet2','$petapt','$petcity','$petstate','$petzip')";
Is this safe/reliable if multiple users are on at the same time? Is there a chance that someone may get another users ID?
I was originally was doing the following:
1) write to database,
2) do a new query with some of the variables I entered into the database in step 1 and get the ID from that query
This seemed to be overkill.
thanks for your thoughts.