Hi mike,

>>>> last_insert_id() will return you the last inserted ID from
>>>> previous 'session', not current 'session'.
>>>> to prevent this, you should call last_insert_id() only when
>>>> your INSERT query executed succesfully.

>> Most probably the returned value would be wrong, because it will
>> return the last_insert_id of previous INSERT query (from previous
>> 'session')

> but of course, you'd have checked that the result id returned a valid result
> and not an error in this case and never looked for the last_insert_id,

Exactly.
That's why in the first posting (read the first paragraph above),
I told him to exec last_insert_id() or mysql_insert_id() ONLY when
the insert query is SUCCESSFUL.

--
Jimmy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When you lose, don't lose the lesson.



-- 
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