How to limit how often a user can update a mysql value to a database

后端 未结 4 2043
我在风中等你
我在风中等你 2021-01-24 16:51

I have a field on my website, which updates a value in my mysql database. I want to make it so the user can only update the value every 3 days. How would I go about doing this?<

4条回答
  •  别那么骄傲
    2021-01-24 17:29

    Use a last updated field in mysql (date and time of last update), and check it before making the update. If satisfies your condition then commit the update and also update that time field, if not show error to the user.

提交回复
热议问题