I am using an api to develop an inventory system for a company. I want to be able to allow the first person to select a row(s) from the mysql database to have a lock. The second person should be denied any data from the set of rows the first user has. Is that even possible?
The use case, the information in the database is constantly being added or updated by users. If user A does a select it will always be followed by an update. But if user B selects the information updates it before user A is done, all the work from user B will be lost when user A is done or visa versa.
I have tried to use transactions but it is not stopping a second user from getting the row the first user requests.
start transaction;
select * from peak2_0.staff where 'First Name'='Aj';
update peak2_0.staff set `First Name` = 'aj' where 'First Name'='Aj';
commit;