SQL query to replace text in threads

Discussion in 'vBulletin' started by MrPJH, Sep 18, 2014.

  1. #1
    UPDATE text SET rawtext = replace(rawtext,  '[testting=123]', '[testing]');
    Code (markup):
    i have to run sql query under vbulletin something like i posted on above
    it works but the problem is =123 represents IDs so each tag have a unique number with it
    i want to build query so it can match any number under this "testting" tag

    any help please
     
    MrPJH, Sep 18, 2014 IP
  2. kpmedia

    kpmedia Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    All you need to do here is use the LIKE syntax.
    WHERE rawtext LIKE 'testing%'
    Code (markup):
    The % is the variable, like *

    I'd have to think about the full command for a second, but I'd rather you now built it, so as not to blame me if anything goes wrong.

    Hope that helps. :)
     
    kpmedia, Nov 4, 2014 IP