Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search and Replace Strings inside "text" fields 1

Status
Not open for further replies.

Tama

MIS
Jun 6, 2001
121
NZ
I've got a website which has a table contain 5meg of articles in 500 entries. I want to search and replace two specific text strings inside these entries.

Is there anyway to do this that doesn't involve downloading a dump file and changing via Textpad etc. ?

Cheers
Tama
 
I had a similar problem a while a ago, and I modified the PHP script that used to query the db and display the result so the script with a regular expression searches for the text I wanted to change and replace it on the fly.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Don't be content with being average. Average is as close to the bottom as it is to the top
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
update yourtable set fieldname = replace(fieldname,'oldphrase','newphrase')
 
Hi guys

Thanks for the tips - Saeed, I have used similar scripts like that in the past, but find the setup and testing of them can be a bit hit and miss. However, PHP scripts absolutely rock for converting tables/data between databases.

Vanekl - that sounds like the ticket. I'll give it a shot when I get home tonight.

Thanks a lot
Tama
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top