Go Back   SZONE.US Forums > Do it yourself (DIY) > Web Tips

Web Tips Tips and tricks specializing in programming languages of the web. ie. PHP, MYSQL, XHTML, CSS, etc

Search and Replace MYSQL

Thread Tools Search this Thread Rate Thread
Unread 09.12.07, 08:33 AM
Zachariah Boren's Avatar
Zachariah Boren Zachariah Boren is offline
Join Date: 02.07
Location: Canoga Park, CA
Posts: 928
Blog Entries: 6
Images: 10075
Send a message via ICQ to Zachariah Boren Send a message via MSN to Zachariah Boren Send a message via twitter to Zachariah Boren
Search and Replace MYSQL

Here is a little trick that saved a lot of time.
I had to search and replace a string of text in a column of data.

mySQL 4.x,5.x

update TABLE set COLUMN = replace(COLUMN, 'OLD_VALUE', 'NEW_VALUE');
Column: COLOR
Search: Red
Replace: Green
update CRAYONS set COLOR = replace(COLOR, 'Red', 'Green');
Hope it helps.
http://www.szone.us | http://www.gzhq.net
Twitter | Facebook | My:Hacks @ vBulletin.org
Member of Kiwanis Club of Chatsworth
Reply With Quote

mysql, replace, search

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Similar Threads
Thread Thread Starter Forum Replies Last Post
Veteran Astronauts Available to Discuss Search for 2009 Class @NASA N.A.S.A. 0 05.01.08 03:05 PM
NASA Mission Finds New Clues to Guide the Search for Life on Mars @NASA N.A.S.A. 0 03.20.08 10:36 AM
NASA Teleconference to Replace Televised Dawn Mission Briefing @NASA N.A.S.A. 0 06.25.07 03:18 PM

All times are GMT -8. The time now is 06:40 AM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright 2007 - 20017 SZONE.US All rights reserved