Gossamer Forum
Home : General : Databases and SQL :

update and substitution in mysql

Quote Reply
update and substitution in mysql
Hi All,

In my linksql database, I have many links from a single site such as

1) http://www.yahoo.com/test/1.html
2) http://www.yahoo.com/test/2.html
3) http://www.yahoo.com/test/3.html

Now I want to update all URLs from that site to another base URL such as

1) http://www.yahoo.com/any/1.html
2) http://www.yahoo.com/any/2.html
3) http://www.yahoo.com/any/3.html

How can I write the update statement in mysql to do the substitution? I remember I have done this before but forgot the code.

Thanks in advance.

Long
Quote Reply
Re: [long327] update and substitution in mysql In reply to
REPLACE()

See mysql.com for more details.
Quote Reply
Re: [Paul] update and substitution in mysql In reply to
Thanks Paul, it works great and saves me lot of time.

Long