What is the best method to make sure two people don't edit the same row on my web app?

后端 未结 6 1947
一生所求
一生所求 2020-12-29 08:57

I have a PHP/jQuery/AJAX/MySQL app built for managing databases. I want to implement the ability to prevent multiple users from editing the same database row at the same ti

6条回答
  •  感情败类
    2020-12-29 09:42

    I personally would not prevent this. If it was a requirement of the job I would track the users' current / last known location and disallow someone from editing the same line someone else is editing this way. I have seen people add a row to a table saying isLocked or isBeingWorkedOn etc... but I have seen this type of system fail far more often as well, or require moderation to unlock stuck tables if someone closed it while working on it etc...

提交回复
热议问题