From: Michael Widenius Date: September 15 1999 10:04pm Subject: locking records List-Archive: http://lists.mysql.com/myodbc/696 Message-Id: <14304.5934.11358.179795@monty.pp.sci.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit >>>>> "Federico" == Federico Balbi writes: Federico> Hello folks, Federico> I need to have multiple users working on an application using MySQL and Federico> people can update records concurrently, in same cases even the same Federico> record but different fields. My question is: does anybody have experience Federico> on locking policies and what should be best to implement or use in a case Federico> like this? What concerns me more is the case 2 or more users edit/update Federico> different fields of the same record. Hi! The simple option is to store the original row and when you update the row you specify the important columns that must be kept together in the WHERE clause: UPDATE table_name SET column='new value' WHERE primary_key=id and column='old_value' and related_column='old value for related column' 'affected rows' will be 0 if someone updated the row between the row was read and it was updated. Regards, Monty