MySQL - apply row level lock using mysqli

Using PHP mysqli, how do you apply row level locking?

Does row level locking stop any editing of current rows that match your criteria? but they do not allow the user to insert a row that matches your criteria?

thanks

+3
source share
2 answers

if you want to block a specific line from editing, use FOR UPDATESELECT at the end of the query. This blocks the row in your transaction and prevents other users from updating it. this only works on transactional storage systems such as innodb.

, , " , ". , ( ) , , - , COMMIT . FOR UPDATE, .

" , , ".

+7

? InnoDB , MySQL.

0

Source: https://habr.com/ru/post/1722787/


All Articles