vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Search and replace on a MySQL table? (https://vborg.vbsupport.ru/showthread.php?t=38552)

DWZ 05-12-2002 11:11 AM

Search and replace on a MySQL table?
 
Is it possible to make phpMyAdmin, or something else to do a search and replace on some text in a database...

You see, I want it to look at my vB database, go into the smilie table, then find anything that says http://www.consoleradar.com/forums/ and replace it with nothing, blank text.

So yeah, when It finds say http://www.consoleradar.com/forums/images/smilies/smile.gif I want it to change to images/smilies/smile.gif

I could do it manually, It's just a lot of smilies to go through...

so yeah, is there some SQL command I can use or something?

Thanks :)

Alan (DWZ)

Admin 05-12-2002 11:20 AM

Code:

UPDATE tblName SET clmName = REPLACE(clmName, 'findText', 'replaceText');
MySQL Docs:
http://www.mysql.com/doc/S/t/String_functions.html

DWZ 05-12-2002 11:39 AM

<n00b> I take it I should be replacing tblName and the two clmName bits of text to something else? - Im guessing tblName should be replaced to smilie but I can't work out what clmName is for... and I hate those MySQL docs, i can never work anything out... lol </n00b>

DWZ 05-12-2002 12:01 PM

OK, FireFly just helped me in the IRC channel...

For anyone who happens to be doing a search and want to know the answer, I used the MySQL command:[sql]UPDATE smilie SET smiliepath = REPLACE(smiliepath, 'http://www.consoleradar.com/forums/', '');[/sql]Thanks FireFly :)

Admin 05-12-2002 12:35 PM

No problems.

How do people know about the [sql] tag before it's even ready for use? :dead:

DWZ 05-12-2002 12:43 PM

Quote:

Originally posted by FireFly
How do people know about the [sql] tag before it's even ready for use? :dead:
[high]* DWZ sees, hears and knows all ;)[/high]

Scott MacVicar 05-12-2002 12:59 PM

/me used it once or twice on some posts, people probably noticed it lol

/me's bad


All times are GMT. The time now is 09:15 PM.

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.00960 seconds
  • Memory Usage 1,720KB
  • 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
  • (1)bbcode_code_printable
  • (1)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