Search and Replace in MySQL Databases


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.