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

WBOY
Release: 2016-10-22 12:06:41
Original
1632 people have browsed it

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?

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template