View Full Version : MySQL Search and replace
tomshawk
11-15-2004, 03:00 AM
Hello Everyone,
While I'm getting better at MySQL I am not this good yet, so, here I am.
I renamed my domain from
http://www.tomshawk.com
to
http://www.tech-unity.com
and while doing searches of templates for static urls and replacing them was quick and easy.
Doing that in the Database, and or Forums, is tedeous to say the least.
What I am wondering is.
Is there a way to set up a script, to search the DB and do this replacement for me.
It would save me a heck of alot of time.
Thanks in advance for any help you can provide.
tomshawk
11-15-2004, 03:24 AM
Hello Everyone,
While I'm getting better at MySQL I am not this good yet, so, here I am.
I renamed my domain from
http://www.tomshawk.com
to
http://www.tech-unity.com
and while doing searches of templates for static urls and replacing them was quick and easy.
Doing that in the Database, and or Forums, is tedeous to say the least.
What I am wondering is.
Is there a way to set up a script, to search the DB and do this replacement for me.
It would save me a heck of alot of time.
Thanks in advance for any help you can provide.
Sorry, this probably should have went into the General Coding MySQL Board.
If a mod wants to move it, please feel free.
Natch
11-15-2004, 03:54 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=38552&highlight=mysql+search+replace" target="_blank">https://vborg.vbsupport.ru/showt...search+replace</a>
tomshawk
11-15-2004, 04:14 AM
https://vborg.vbsupport.ru/showthread.php?t=38552&highlight=mysql+search+replace
Thank you for the help, question though, as I'm a mySQL ID10T
Should it be
UPDATE post SET clmName = REPLACE(clmName, 'http://www.tomshawk.com', 'http://www.tech-unity.com');
I figured out the tblName, but what is the clmName?
Is it Column name, and just for giggles and a guess, would it be "pagetext"
so the line would look like
UPDATE post SET pagetext = REPLACE(pagetext, 'http://www.tomshawk.com', 'http://www.tech-unity.com');
Thank you for any additional help you can provide
Natch
11-16-2004, 02:46 AM
Just to cover all your possibilities, UPDATE post SET pagetext = REPLACE(pagetext, 'tomshawk.com', 'tech-unity.com');But you have it right, well done :)
tomshawk
11-16-2004, 04:40 AM
Thank you Natch,
It worked perfectly ;) To bad we cant gice Reputation/karma here, You deserve some :p
Natch
11-16-2004, 09:58 PM
Cheers ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.