XF 1.5 find & replace query post table

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?
 
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!
 
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: ', '');
 
Top Bottom