debbieau1
asked on
last record ID
I am inserting record then getting the id using mysql_insert_id() from an auto increment field.
Will it always pull up the last id, entered by that user, or if another user add something, is there a risk it could pull up the id for their record?
Will it always pull up the last id, entered by that user, or if another user add something, is there a risk it could pull up the id for their record?
It will always be for the user session, irrespective of what other users do. It is stored specific to the user session, in other words.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks, that's a great help
Can I confirm that in my case last_insert_id() would be better to use. I am not clear on the difference.
Also I did read somewhere that using mysql_insert_id() is a time bomb for very large tables.
Can I confirm that in my case last_insert_id() would be better to use. I am not clear on the difference.
Also I did read somewhere that using mysql_insert_id() is a time bomb for very large tables.