Home >Backend Development >PHP Tutorial >How to automatically update a field in a data table at a fixed time every day

How to automatically update a field in a data table at a fixed time every day

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-10-22 12:06:411633browse

For example: limit refresh to 10 times a day, and then automatically restore to 10 at a certain time in the early morning every day; if(date('H:i:s',time())=='00:00:00' {<br> M('count')->where(array('id'=>1,'count'=>10))->save()<br> }But this definitely won’t work, because it’s impossible to refresh the page at exactly midnight.
It is a time trigger similar to event in MYSQL.
Who knows how to operate in thinkphp?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:ThinkPHP5 bug submissionNext article:ThinkPHP5 bug submission