Announcement

Collapse
No announcement yet.

Find & Replace text in specific forum

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Find & Replace text in specific forum

    I posted a question in another thread, but was asked to open a new thread. So I was wondering how to search and replace some text from a specific forum.

    I initially wrote:

    Originally posted by fxm View Post
    How would I perform a find / replace query for a specific forum id?

    I understand the 1st part would be:

    UPDATE post SET pagetext = REPLACE(pagetext, 'old text', 'new text')

    But not too sure on the 2nd part. I'm guessing something like this?

    WHERE forumid = xx

    Your help would be appreciated, thanks.
    To which vB support replied:

    Originally posted by Mark.B View Post

    No that won't work because the post table has no forumid. The forumid is in the thread table so you'd need to join that first.

    Probably best to start a new thread for this, as this thread is nine years old.
    How would I go about achieving this. What query would I need to run?

    Thanks.


  • #2
    i would use this query :

    Code:
    UPDATE post as A
    SET A.pagetext = REPLACE(A.pagetext, 'old text', 'new text')
    WHERE A.threadid in ( select B.threadid
                          from thread as B
                          where B.forumid = xx)
    beware of prefixes if u use them for the tables post and thread

    Comment


    • #3
      Originally posted by pet0etie View Post
      i would use this query :

      Code:
      UPDATE post as A
      SET A.pagetext = REPLACE(A.pagetext, 'old text', 'new text')
      WHERE A.threadid in ( select B.threadid
      from thread as B
      where B.forumid = xx)
      beware of prefixes if u use them for the tables post and thread
      Worked perfect; many thanks.

      Comment

      Related Topics

      Collapse

      Working...
      X