942,520 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 1236
  • PHP RSS
Jun 23rd, 2010
0

Charset problems with PHP & MySQL

Expand Post »
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!
Attached Thumbnails
Click image for larger version

Name:	charset_problems.png
Views:	113
Size:	448.3 KB
ID:	15527  
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
benkus is offline Offline
36 posts
since Jan 2010
Jun 24th, 2010
0
Re: Charset problems with PHP & MySQL
Its not php poblem..
try
PHP Syntax (Toggle Plain Text)
  1. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Reputation Points: 11
Solved Threads: 6
Junior Poster
sam023 is offline Offline
164 posts
since Jun 2009
Jun 24th, 2010
2
Re: Charset problems with PHP & MySQL
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
Last edited by imvivekkapoor; Jun 24th, 2010 at 2:16 am.
Reputation Points: 11
Solved Threads: 1
Newbie Poster
imvivekkapoor is offline Offline
2 posts
since Jun 2010
Jun 24th, 2010
0
Re: Charset problems with PHP & MySQL
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! =)
Reputation Points: 10
Solved Threads: 0
Light Poster
benkus is offline Offline
36 posts
since Jan 2010

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC