Ad:
 
  • PHP Discussion Thread
  • Marked Solved
  • Views: 470
  • PHP RSS
Similar Threads
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:	28
Size:	448.3 KB
ID:	15527  
Reputation Points: 10
Solved Threads: 0
Light Poster
benkus is offline Offline
25 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: 10
Solved Threads: 6
Junior Poster
sam023 is offline Offline
162 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 1:16 am.
Reputation Points: 11
Solved Threads: 1
Newbie Poster
imvivekkapoor is offline Offline
1 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
25 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.
Message:





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


Follow us on Twitter


© 2010 DaniWeb® LLC