Return to Snippet

Revision: 47283
at June 4, 2011 04:00 by iroybot


Updated Code
UPDATE tablename SET fieldname =
replace(fieldname, searchstring, replacestring);

;example changing domain in wordpress posts

UPDATE wp_posts SET post_content =
replace(post_content, 'www.domain.de', 'domain.com');

Revision: 47282
at June 4, 2011 03:59 by iroybot


Updated Code
UPDATE table SET field =
replace(field, searchstring, replacestring);

;example changing domain in wordpress posts

UPDATE wp_posts SET post_content =
replace(post_content, 'www.domain.de', 'domain.com');

Revision: 47281
at June 4, 2011 03:58 by iroybot


Initial Code
UPDATE tabellenname SET feldname =
replace(feldname, suchstring, ersatzstring);

;example

UPDATE wp_posts SET post_content =
replace(post_content, 'www.domain.de', 'domain.com');

Initial URL


Initial Description


Initial Title
Search and Replace in MySQL Databases

Initial Tags
mysql, sql, search, replace

Initial Language
SQL