Answer the question
In order to leave comments, you need to log in
How to temporarily close access to the database?
I have a table with points.
How to make it so that while one removes / replenishes points, the other person cannot do the same?
Example: there are points-A (points) and points-B (tiles)
They can be converted into each other. Both tables are limited in number (max points = 100, max tiles = 50000) throughout the database.
How to make it so that while one converts tiles to points, no one can do this (so that it does not happen that both exchange points and they suddenly become -10)?
Answer the question
In order to leave comments, you need to log in
Locks in MySQL on Habré.
In short:
LOCK TABLES tiles, points WRITE;
-- тут конвертируем одно в другое
UNLOCK TABLES;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question