Posted by Sanders Kaufman on 07/20/07 20:39
newbie wrote:
> Thanks for the answer. But I undersatnd mysql_insert_id() is to
> 'Retrieves the ID generated for an AUTO_INCREMENT column by the
> previous INSERT query.'. How to deal with the situation that multi-
> users insert rows concurrently?
That's only a problem if you use the SELECT method.
If you use mysql_insert_id or (whatever that command is) it gets the
last insert *on that connection*. So as long as two different users are
using two different connections, you don't have to worry about getting
back the wrong ID.
Navigation:
[Reply to this message]
|