PDA

View Full Version : Change character to another in MYSQL table


wterpilo
12-28-2008, 03:38 PM
Hi
I've just figured out some problem I just had with my translation and I wanted to share it with you guys :)
In database in language phrases for my national characters I have something like &# 243; (I have to use space because vbulletin is changing it to my character :) ) and this is converted on the site to my national character. But when I wanted to export my language to xml I had some problems. It occured that instead of &# 243; I had letter 'ó' which is my national character. This was my problem. I found out that I would need to correct about 340 rows. If I would do that manually it would take me all day. So I found out how I can change only 1 character to another in all table in specified column :)
To do that you should use REPLACE
UPDATE ilance_language_phrases
SET text_pol = REPLACE(text_pol, 'ó', '&# 243;');

I hope that will save your time :)

Wojtek

Peter
12-29-2008, 12:27 PM
Brilliant. I've used this only once in the past but this thread will no doubt be extremely useful in the future :-)

Thanks