MySQL Find and Replace Query

Something I frequently find myself having to do is using a find and replace query to change out some text inside of entries inside a database table. So I wanted to throw the syntax on the blog!

UPDATE `YOUR_DATABASE_TABLE`
SET `YOUR_FIELD_NAME` = REPLACE(`YOUR_FIELD_NAME`, 'find this', 'replace with this')

Works like a charm!

Wednesday, November 11th, 2009 MySQL

Leave a Reply

You must be logged in to post a comment.

[ad code=1 align=center]