mysql query: bulk replace patterns of text

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
stevegos

mysql query: bulk replace patterns of text

Post by stevegos »

Hi

I am moving a static web site over to cmsms (latest version).

Within the html of the old site there are a few hard coded links that will need changing once on cmsms.

There are over 100 pages so I don't want to have to do this manually.

In phpmyadmin, can I create a sql query which will look for a certain pattern of text (its the same on all pages) in the content pages and replace it with another?

I'm not that good with my sql. All help greatly appreciated.

Steve
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: mysql query: bulk replace patterns of text

Post by Jos »

Someting like this?

Code: Select all

UPDATE tablename SET fieldname=REPLACE(fieldname,'from_str','to_str')
Post Reply

Return to “The Lounge”