MySQL Find and Replace
February 5th, 2008Read More mysql
One of the most common things that needs to be done when tidying up a database is to bulk find and replace data in MySQL tables. This can be for things like spelling mistakes, changing categories of products or any other value held in a MySQL database table.
Its an easy thing to do though and here is the code:
MySQL:
-
UPDATE [table_name] SET [field_name] = REPLACE([field_name],'[string_to_find]','[string_to_replace]');
note - nice syntax highlighting plugin used is mentioned here
