PDA

View Full Version : UPDATE link in SQL


TeckTP
11-26-2020, 07:15 AM
Hi,
We recently changed our forums url from www.olddomain.com to www.newsub.olddomain.com
We are using olddomain.com for more then 4 years and there are lots of posts with guide in posts with Photos IMG link to www.olddomain.com, but now we are change to www.newsub.olddomain.com and many posts have wrong IMG link.

Is there a way to replace this from entire database ?

Greet Tom

yilmaz
11-26-2020, 07:36 AM
It should be if you run this in SQL query


UPDATE `text` SET `rawtext` = REPLACE(`rawtext`, 'www.olddomain.com', 'www.newsub.olddomain.com') WHERE `rawtext` LIKE '%www.olddomain.com%';

TeckTP
11-26-2020, 07:48 AM
Sometings is wrong.

MySQL meldet: Dokumentation

1146 - table doesn’t exist’ error

--------------- Added 1606385697 at 1606385697 ---------------

OK correct:
UPDATE `vbtext` SET `rawtext...
now everything is OK.

Thank You