The database needs to be updated on time. a download system requires that each user only download 10 times a day. the database sets a table segment to record the number of downloads per day. when the number of downloads reaches 10. It cannot be downloaded. However, as the server time changes, the number of downloads of all users changes to 0 when the server date is over 0. To automate this operation, the administrator does not need to manually reset the data in the database every day. How should this requirement be implemented in PHP and databases? ------ Solution ------ Database updated on time
To create a download system, each user must download only 10 times a day. set a table segment in the database to record the number of downloads per day. when the number of downloads reaches 10. It cannot be downloaded.
However, as the server time changes, the number of downloads of all users changes to 0 when the server date is over 0.
To automate this operation, the administrator does not need to manually reset the data in the database every day.
How should this requirement be implemented in PHP and databases?
------ Solution --------------------
Discussion
Reference:
The user can determine and update the download time based on the previous download time.
It is not calculated in 24 hours. The time interval is day. He can download it for the tenth time. You can perform the first download on the next day in 1 minute.
------ Solution --------------------
Cronjob,
Mysql event can also be implemented