Saturday, 10 August 2013

Update table row every minute using with Cron Job

Update table row every minute using with Cron Job

I am trying to update table row every minute when crondate(timestamp
field) and current timestamp match. When both match i am setting state = 0
but not working. I have check cronjob and it is working and executing
every miniute.
I will thankful If anyone can help me.
My Code:
function runCronJob(){
$timestamp = date('Y-m-d H:i:s');
$db =& JFactory::getDBO();
$update_query = "UPDATE #__cronjob_run SET state=0 WHERE crondate =
'$timestamp'";
$db->setQuery($update_query);
$db->query();
}

No comments:

Post a Comment