Hello John,

Wednesday, August 01, 2001, 11:06:06 AM, you wrote:


JM>   In an environment where it's possible to have multiple
JM>   users register at the same time (relatively speaking), how can I be sure
JM>   that the 'last ID' is indeed the 'intended' last user's ID?

JM>   Ex.
JM>    Say that user A submit a registration form at 00:00:01, but
JM>    mysql_inserted_id is not called (for user A) until 00:00:03.

JM>    If user B submits a registration for at 00:00:02, then would
JM>    the call to mysql_insert_id (for user A---called at 00:00:03) return
JM>    the ID for user B?

JM>    Technically, it sounds like it would, unless mysql_insert_id implements
JM>    some type of session and/or state recognition.
JM>    Is that how it works?

JM>    --How can I be sure that it returns the ID for user A and not B?

You can be 100% sure, 'cause mysql_insert_id() returning last inserted
id in current connection to database.

User A has another connection ID as user B.

I hope it helps

-- 
Best regards,
 Daniel                            mailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to