1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 find & replace query post table

Discussion in 'XenForo Questions and Support' started by dutchbb, Mar 15, 2016.

  1. dutchbb

    dutchbb Well-Known Member

    This is what I need:

    Code:
    FIND IN XENFORO DATABASE POST TABEL:
    
    [IMG]http://forum.mydomain.com/images/rating/star1.png[/IMG]
    [IMG]http://forum.mydomain.com/images/rating/star2.png[/IMG]
    [IMG]http://forum.mydomain.com/images/rating/star3.png[/IMG]
    [IMG]http://forum.mydomain.com/images/rating/star4.png[/IMG]
    [IMG]http://forum.mydomain.com/images/rating/star5.png[/IMG]
    [IMG]http://forum.mydomain.com/images/rating/star6.png[/IMG]
    [IMG]http://forum.mydomain.com/images/rating/star7.png[/IMG]
    [IMG]http://forum.mydomain.com/images/rating/star8.png[/IMG]
    [IMG]http://forum.mydomain.com/images/rating/star9.png[/IMG]
    [IMG]http://forum.mydomain.com/images/rating/star10.png[/IMG]
    
    REPLACE WITH:
    
    [IMG]http://forum.mydomain.nl/styles/default/mydomain.nl/review_rating/star1.png[/IMG]
    [IMG]http://forum.mydomain.nl/styles/default/mydomain.nl/review_rating/star2.png[/IMG]
    [IMG]http://forum.mydomain.nl/styles/default/mydomain.nl/review_rating/star3.png[/IMG]
    [IMG]http://forum.mydomain.nl/styles/default/mydomain.nl/review_rating/star4.png[/IMG]
    [IMG]http://forum.mydomain.nl/styles/default/mydomain.nl/review_rating/star5.png[/IMG]
    [IMG]http://forum.mydomain.nl/styles/default/mydomain.nl/review_rating/star6.png[/IMG]
    [IMG]http://forum.mydomain.nl/styles/default/mydomain.nl/review_rating/star7.png[/IMG]
    [IMG]http://forum.mydomain.nl/styles/default/mydomain.nl/review_rating/star8.png[/IMG]
    [IMG]http://forum.mydomain.nl/styles/default/mydomain.nl/review_rating/star9.png[/IMG]
    [IMG]http://forum.mydomain.nl/styles/default/mydomain.nl/review_rating/star10.png[/IMG]
    
    What would be the quickest way of doing this? Can it be done in a single query?
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Code:
    UPDATE xf_post
    SET message = REPLACE(message, '[IMG]http://forum.mydomain.com/images/rating/', '[IMG]http://forum.mydomain.nl/styles/default/mydomain.nl/review_rating/');
    Take a backup first!
     
    dutchbb likes this.
  3. dutchbb

    dutchbb Well-Known Member

    Tnx worked perfectly.

    Ok let's see if I can do this, so if I want to remove a specific part followed by a space in the title of all threads, can I do this:

    Code:
    UPDATE xf_thread
    SET title = REPLACE(title, 'Supplement Review: ', '');
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, that should work.
     
    dutchbb likes this.

Share This Page