The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
SQL query to find/repalce post text in a specific forum
Hello,
I am trying use a sql query to find and replace a certain word in a specific forum. I tried the following but that did not work. Code:
UPDATE post SET pagetext = REPLACE(pagetext, 'oldtext', 'newtext') WHERE forumid='435' An error occurred while attempting to execute your query. The following information was returned. error number: 1054 error desc: Unknown column 'forumid' in 'where clause' Any help is appreciated. Thank you. |
#2
|
||||
|
||||
Well, as the error says, there is no forumid column in the post table. You would need to join with the thread table (post.threadid = thread.threadid) in order to get the forumid (thread.forumid).
|
#3
|
|||
|
|||
Quote:
Code:
UPDATE post SET pagetext = REPLACE(pagetext, 'oldtext', 'newtext') WHERE (SELECT forumid FROM thread WHERE thread.threadid = post.threadid) = 435 |
#4
|
|||
|
|||
Quote:
That worked like a charm! Thanks a lot. Some questions: 1. What if I want to replace multiple words? 2. For multiple Child forums, is it possible to select a parent forum? This will cut down a lot of time for me. Thanks again. |
#5
|
|||
|
|||
Code:
UPDATE post SET pagetext = REPLACE(pagetext, 'oldtext', 'newtext') WHERE (SELECT forumid FROM thread WHERE thread.threadid = post.threadid) = (SELECT forumid FROM forum WHERE parentid = 435) |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|