vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   MySQL Search and replace (https://vborg.vbsupport.ru/showthread.php?t=71764)

tomshawk 11-15-2004 03:00 AM

MySQL Search and replace
 
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

Quote:

Originally Posted by tomshawk
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+repl ace" target="_blank">https://vborg.vbsupport.ru/showt...search+replace</a>

tomshawk 11-15-2004 04:14 AM

Quote:

Originally Posted by Natch

Thank you for the help, question though, as I'm a mySQL ID10T

Should it be

Code:

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

Code:

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, [sql]UPDATE post SET pagetext = REPLACE(pagetext, 'tomshawk.com', 'tech-unity.com');[/sql]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 ;)


All times are GMT. The time now is 08:37 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03022 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete