![]() |
SQL query to assign threads a prefix
I'm needing to assign all threads in a specific forum that do not currently have a prefix to an existing prefix. Is there some kind soul out there that could show me an SQL query that would do such a thing? I sure would appreciate it. Thanks in advance.
|
First, in "prefix" table of vBulletin find your desired "prefixid" (it could be an alphabetic name or numerical one). In my case, it's id is "test".
Now run this query in "thread" table: Code:
UPDATE `thread` SET `prefixid` = 'test' WHERE `forumid` = 1; Before running any query, please make a backup of your thread table. |
Thanks! much appreciated. This looks like it may set ALL threads to that prefix instead of just threads without a prefix, but what do I know. :-) I'll test it out before using it in a critical forum and report back.
--------------- Added [DATE]1517934535[/DATE] at [TIME]1517934535[/TIME] --------------- This worked with a slight modification to achive my desired results: Code:
UPDATE vb_thread SET prefixid = '1' WHERE forumid = 10 and prefixid <> '3' and prefixid <> '2' |
You can use AND query
Code:
UPDATE `thread` SET `prefixid` = 'test' WHERE `forumid` = 1 AND 'prefixid' ='' My appreciation my friend |
All times are GMT. The time now is 05:31 AM. |
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:
|