on 1/16/02 10:47 AM, Jimmy at [EMAIL PROTECTED] wrote:

> Hi DL,
>>> the only problem i can think of might occur with pconnect is,
>>> 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.
>> =Of course a "right-living" boy like me, cannot conceive of why one would
>> look up LAST_INSERT other than immediately after the INSERT/UPDATE command...
> calling last_insert_id() after INSERT is the number one rule
> of course :)
> What i mean was, what if the INSERT query fail, but the script still
> execute the last_insert_id() function?
> 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,


 -- mike cullerton   michaelc at cullerton dot com

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