How to search and replace data in MySQL


Finding a string in a set of MySQL result rows and replacing the text is very easy. Use the following command as a template:

UPDATE
	[table_name]
SET
	[field_name] = REPLACE(
				[field_name],
				'[string_to_find]',
				'[string_to_replace]'
			);

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word