Home > MySQL > String replace in MySQL

String replace in MySQL

December 4th, 2013 Leave a comment Go to comments

Change a part of text in a MySQL database, can execute with the command REPLACE().

Example: change HTML bold text in the ‘description’ field that uses B tag with STRONG tag.

UPDATE texts SET description = REPLACE(description, ‘B>’, ‘STRONG>’);

  1. No comments yet.
  1. No trackbacks yet.