![]() |
Query to close threads with a prefix?
I'd like to use an SQL query to close all threads in a specific forum that have a specific prefix (prefix=product version). I don't know how to create queries. The best I can come up with is this:
Code:
UPDATE thread |
It's a lot easier than you think:
HTML Code:
UPDATE thread SET open = 0 WHERE prefixid = X AND forumid = X |
Quote:
Btw, it is possible to change your codes to close all threads with 1 post or they are old posts with 1 post (I mean it has no answer on its thread)? |
Quote:
|
Quote:
For example, the following SQL query will close all threads that are older than 1 week and have no replies: HTML Code:
UPDATE thread SET open = 0 WHERE replycount = 0 AND lastpost < UNIX_TIMESTAMP(NOW() - INTERVAL 1 WEEK) |
All times are GMT. The time now is 05:39 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|