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
Retrieving Special Characters From MySQL Database
Moderator: General Moderators
-
michaeln31
- Forum Newbie
- Posts: 3
- Joined: Wed Jan 12, 2011 6:47 pm
-
thecodewall
- Forum Commoner
- Posts: 33
- Joined: Sun Dec 26, 2010 8:37 am
Re: Retrieving Special Characters From MySQL Database
Check your database setting I think its different compare to your localhost database.
-
michaeln31
- Forum Newbie
- Posts: 3
- Joined: Wed Jan 12, 2011 6:47 pm
Re: Retrieving Special Characters From MySQL Database
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
Thanks again,
Mike
Re: Retrieving Special Characters From MySQL Database
Try calling once
after DB is selcted.
Code: Select all
SET NAMES utf8There are 10 types of people in this world, those who understand binary and those who don't
-
michaeln31
- Forum Newbie
- Posts: 3
- Joined: Wed Jan 12, 2011 6:47 pm
Re: Retrieving Special Characters From MySQL Database
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
Mike