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 updated on time in the database?
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
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service