Reputation: 3964
I want to reset my mysql table column every day (12 AM), week and month. I have just single row in my mysql table.
$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 ???
}
I have tried this above code for reset table column every day. But, I'm not sure. Is this the right way to reset column? If it is correct then How do I do this for week and month?
Upvotes: 0
Views: 880
Reputation: 54
What about use crontab?
Make a shell script with mysql command line tool.
Upvotes: 0