Yes that's what I mean I arranged to have single queries for the inserts.
For example I avoid doing a select on criteria to retrieve that id an then
an update of this id.
thanks for help!!!
>From: Philippe Poelvoorde <philippe@stripped>
>Reply-To: "'mysql@stripped '" <mysql@stripped>
>To: mel list_php <list_php@stripped>
>Subject: Re: last_insert_id
>Date: Tue, 15 Feb 2005 10:50:40 +0000
>mel list_php wrote:
>>I have a database where several users can connect and input data.
>>I managed to have my insert queries as atomic, but I was wondering about
>>one special case: I make one insert, and retrieve the last id inserted by
>>mysql because I need to update an other table with that id.
>>- if one user inserts and retrieves the id, but between both one other has
>>inserted something the id returned will be the right one?
>Last_insert_id() is consistent on a per-connection basis, meaning you don't
>need to use lock (hopefullly !)
>btw, what do you mean by : "I managed to have my insert queries as atomic".
>Because if you do : INSERT .... it's already suppose to be atomic.
>COS Trading Ltd.
It's fast, it's easy and it's free. Get MSN Messenger today!