| The Arcive of vBulletin Modifications Site. | |
| 
			 
			#1  
			
			
			
			
			
		 | ||||
| 
 | ||||
|  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.
		 | 
| 
			 
			#2  
			
			
			
			
			
		 | |||
| 
 | |||
|   
			
			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. | 
| 
			 
			#3  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			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' | 
| 
			 
			#4  
			
			
			
			
			
		 | |||
| 
 | |||
|   
			
			You can use AND query Code: UPDATE `thread` SET `prefixid` = 'test' WHERE `forumid` = 1 AND 'prefixid' ='' My appreciation my friend | 
|  | 
| 
 | 
 | 
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
| 
 | |
|  More Information | |
| Template Usage: 
 Phrase Groups Available: 
 | Included Files: 
 Hooks Called: 
 |