Page 1 of 1

Retrieving Special Characters From MySQL Database

Posted: Wed Jan 12, 2011 6:57 pm
by michaeln31
Hey,

I've been trying to retrieve certain characters from my mySQL database, characters such as 'ç' and 'á'. I use these characters in certain words, such as 'Français' in a menu for my site. The menu works fine on my localhost, all characters are displayed properly, however when I upload my site and database to my server, 'ç', for example, becomes '�' or '?'. Seeing as it works on my localhost I'm guessing that it is a setting issue with my server's database or I've just coded my menu to suit my localhost only.

Any ideas?

Mike

Re: Retrieving Special Characters From MySQL Database

Posted: Wed Jan 12, 2011 8:12 pm
by thecodewall
Check your database setting I think its different compare to your localhost database.

Re: Retrieving Special Characters From MySQL Database

Posted: Thu Jan 13, 2011 5:52 am
by michaeln31
The only settings I can think of are MySQL charset and MySQL connection collation. I've tried changing the collation but with no effect, I cannot figure out how to change the charset. Could this be where the problem lies? The charset on the server is set to UTF-8 Unicode (utf8), which i thought should work ok, I've set my localhost to the same as my server and it seems to work fine. Are there other settings I should be looking at?


Thanks again,

Mike

Re: Retrieving Special Characters From MySQL Database

Posted: Thu Jan 13, 2011 6:58 am
by VladSun
Try calling once

Code: Select all

SET NAMES utf8
after DB is selcted.

Re: Retrieving Special Characters From MySQL Database

Posted: Tue Jan 18, 2011 4:07 am
by michaeln31
Nope, had no effect. What's confusing me is that when i set my localhost similar to my server it works fine. Is there another reason this would be happening?


Mike