MySQL PHP and special character problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kountz
Forum Newbie
Posts: 3
Joined: Thu Dec 17, 2009 10:18 am

MySQL PHP and special character problem

Post by kountz »

I've built a really simple database that gets updated via some small php scripts. The database has multiple translations in it, which initially are all in English.

The problem i'm having is that everything works fine until i update one of the translations with say Finish which has bucket loads of special characters. The fields that contain special characters don't get updated and i can't figure out how to get round it. I've taken a look at the collation of the fields but I'm a novice in SQL. Currently the translations fields are set to 'utf8_general_ci'.

Has anyone else come across this problem? and point me in the right direction of a solution?
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: MySQL PHP and special character problem

Post by Darhazer »

Do you use mysql_real_escape_string() before sending data to MySQL?
Is your page also with UTF-8 encoding?
What is the connection encoding? Maybe you have to perform SET NAMES before sending data to MySQL?
Post Reply