Support Forums

Full Version: Update Mysql Row After X Days
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a cron job set to run the following query everyday...

PHP Code:
$sql mysql_query("UPDATE `mybb_users` SET style='3' WHERE `date` < DATE_SUB(NOW(), INTERVAL 10 DAY)  uid='$uid'"); 

Which automatically updates a row that is older than 10 days. For some reason, I can't get it to work.

Can somebody help me fix it?

Thanks in advance! Smile
$db->query("UPDATE `mybb_users` SET style='3' WHERE `date` < DATE_SUB(NOW(), INTERVAL 10 DAY) uid='$uid'");

Try that...make sure the $db class is called and part of global.