Replace a Character in a MySql Database field

 
MySql :  M8ty
  
Replace a Character in a MySql Database field
avatar
Posted by: m8ty ()
Date: August 27, 2008 12:31PM

In one of my MySql databases I need to replace one character in one specific field with another set of characters. With around 600 records I did not want to do this manually. A google search found the following solution (as yet untested, only posted as a reminder):

SQL:
update <table_name>
set <field> = replace(<field>,'original','new');


replace <table_name> with table name, and <field> with the field you are targeting.

(this solution was found on http://www.vinhboy.com/blog/item/2008/05/how-to-fix-strange-characters-in-mysql-database



Edited 1 time(s). Last edit at 08/28/2008 03:52PM by m8ty.

Options: ReplyQuote
Re: Replace a Character in a MySql Database field
avatar
Posted by: m8ty ()
Date: August 28, 2008 03:53PM

... yes ... it worked!!!

Options: ReplyQuote


 
Useful Links:
| Thomson Holidays | Macromedia Dreamweaver Tutorial | Troubleshooting Vista Network Issues | How to Backup Windows Live Mail Accounts, Contacts and Messages | 1and1FAQ |