I'm trying to add a row to a table, and then immediately get its unique ID, which is simply an autoincremented column.
Googling tells me PHP can do this through the mysql_insert_id() method, which
Retrieves the ID generated for an AUTO_INCREMENT column by the previous query (usually INSERT).
Is the "previous query" limited in scope to this specific connection, or is it possible that if somehow another row is inserted before I call it, it will return the wrong ID?
Are there any better suggestions on how to get or set a unique ID for a row? I'd make the unique ID on the client-side, but there are multiple clients, so that's not really possible.
Thanks.