BRACHET,STEPHAN (Non-HP-France,ex1) wrote: > Hello, > > I need to do an update on a table : > > ***** Something like this : ***** > UPDATE my_table mt > SET mt.field1 = mt.field1 + 1 > WHERE mt.id = 100 > ********************************* > > And there can have concurrent updates on this record. is there a risk of 2 > (or more) updates done at the same time and my field and the result of the > query to damage the field or does all the updates done in a queue ... ? Do I > have to do a lock table before the update ? > > Thank you for your help > > Stef > Webmaster of Atoova > http://homecinema.atoova.com > (running under php/mysql) >
Hi, There is no risk and you don't need to lock the table yourself. Depending of the type of table you use, MySQL will automatically lock the entire table (myisam table type) or just the row (InnoDB). Regards -- Joseph Bueno --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php