Posted By

iroybot on 06/04/11


Tagged

mysql sql search replace


Versions (?)

Search and Replace in MySQL Databases


 / Published in: SQL
 

  1. UPDATE tablename SET fieldname =
  2. REPLACE(fieldname, searchstring, replacestring);
  3.  
  4. ;example changing domain IN wordpress posts
  5.  
  6. UPDATE wp_posts SET post_content =
  7. REPLACE(post_content, 'www.domain.de', 'domain.com');

Report this snippet  

You need to login to post a comment.