我想要重置我的mysql表列,每天(上午12点),每周和每月。我的mysql表中只有一行。
$current_date = date_default_timezone_set('Asia/Kolkata');
$current_date = date('H:i:s');
$timestamp = strtotime($current_date);
$gettime = date("h:i A", $timestamp);
if($gettime == "11:59 PM")
{
update mysql table column to 0 ???
}我每天都会尝试上面的代码来重置表列。但是,我不确定。这是重置列的正确方法吗?如果它是正确的,那么我该如何为周和月做这件事?
发布于 2014-09-30 15:30:03
使用crontab怎么样?
使用mysql命令行工具创建shell脚本。
https://stackoverflow.com/questions/26115070
复制相似问题