"older than 30 days." - based on thread creation date or last post?
For last post:
UPDATE thread SET open=0 WHERE lastpost < UNIX_TIMESTAMP(DATE_ADD(NOW(), INTERVAL -30 DAY)) AND forumid IN (10,11,12)
For thread creation date:
UPDATE thread SET open=0 WHERE dateline < UNIX_TIMESTAMP(DATE_ADD(NOW(), INTERVAL -30 DAY)) AND forumid IN (10,11,12)
(10,11,12 are just examples for the forum ids)
|