Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Update Mysql Row After X Days
#1
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
Reply
#2
$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.
Superman I am here to rescue you.
This is Support Forums not Support PMs.  Do not PM me for support unless it's private and site related.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  My PHP Project, V.03 [UPDATE] ChromeWolf 3 1,156 11-17-2011, 12:59 PM
Last Post: HF~Legend
  optimize mysql through a php script andrewjs18 7 3,377 10-05-2011, 06:31 PM
Last Post: John.
  Creating a simple PHP/MySQL login script ndee 16 10,530 05-14-2011, 02:18 AM
Last Post: モrainee
  Simple MySQL Tutorial Sly 4 1,323 05-14-2011, 01:53 AM
Last Post: Sly
  PHP Echo HTML From MySQL Value? iMr 7 3,798 03-19-2011, 09:41 AM
Last Post: ★Cooldude★

Forum Jump:


Users browsing this thread: 2 Guest(s)