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

XF 1.2 sql search and replace

AndyB

Well-known member
#2
To update posts I use this in phpMyAdmin

UPDATE xf_post SET message = REPLACE(message, 'old text', 'new text')
 

cmeinck

Well-known member
#5
Following up my title post, I'd like to do something similar within posts. However, my concern is that it will also affect URLs that have the same term. For example, if I do this:

Code:
UPDATE xf_post SET message = REPLACE(message, 'iphone','iPhone');
Any website with iphone in the URL would change to http://iPhone.apple.com instead of the proper http://iphone.apple.com

Would this second run address specific cases?

Code:
UPDATE xf_post SET message = REPLACE(message, 'iPhone.apple','iphone.apple');
I don't want to adversely affect other words with the replace, so using caution and seeking advice. Does it see iPhone.apple as a single term?