Update Mysql Row After X Days - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: PHP The Hypertext Preprocessor (https://www.supportforums.net/forumdisplay.php?fid=21) +---- Thread: Update Mysql Row After X Days (/showthread.php?tid=4738) |
Update Mysql Row After X Days - Dutchcoffee - 02-08-2010 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! RE: Update Mysql Row After X Days - Omniscient - 02-08-2010 $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. |