954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Charset problems with PHP & MySQL

Hello! =)

I have a big problem here, with PHP charset stuff. My mysql is utf8_hungarian_ci , but the php shows me only '?' and ?inDiamond signs. I guess the PHP's working incorrectly, because my MySQL returns my records just fine.

Any solutions? =)

Thank you!

Attachments charset_problems.png 448.32KB
benqus
Light Poster
39 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

Its not php poblem..
try

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
sam023
Junior Poster
164 posts since Jun 2009
Reputation Points: 11
Solved Threads: 6
 

Hi benkus,

Please change the following setting for your database:

MySQL charset : UTF-8 Unicode (utf8)
MySQL connection collation : utf8_general_ci
MySQL collation : utf8_general_ci


You can also try this : After selecting database mysql_select_db(dbname); use mysql_query('set names "utf8"');

Hope this help..

KPs

imvivekkapoor
Newbie Poster
2 posts since Jun 2010
Reputation Points: 11
Solved Threads: 1
 

Oh yea, the mysql_query("SET NAMES 'utf8'") has solved my problem, thank you! =) But the charset does not need to be switched back. Works like a charm! =)

benqus
Light Poster
39 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: