Viewing Chinese characters from a MySQL Database results in ?????????

Hi All,

I am having problems with a MySQL database that contains chinese characters.  When I retrieve the data via a recordset the Chinese characters change to "?" marks while the rest of the data is fine.

I have checked the data using phpAdmin and it is in the correct in the database and displays fine.  So I presume that I have correctly set up the table to handle this type of data.  The collations type is UTF8_unicode_ci.  

Below is the top part of the code for the page.  Can anyone see what I am doing wrong.



<?php require_once('../../Connections/Location.php'); ?>
<?php header("Content-type: text/html; charset=utf-8");?>
<?php
mb_http_output('utf-8');
mysql_select_db($database_Location, $Location);
mysql_query("SET NAMES 'UTF-8'");
$query_Recordset1 = "SELECT * FROM tblLocation";
$Recordset1 = mysql_query($query_Recordset1, $Location) or die(mysql_error());
 mysql_query("SET NAMES 'UTF-8'");
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>
LVL 4
awilde2000Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dodge20Commented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
awilde2000Author Commented:
I had a look but I don't think it is a problem with MySQL as I can view the records via PHPAdmin perfectly,  just when I display them on my page I get the error.  Is there some thing I need to set in the connection?
awilde2000Author Commented:
I had a look but I don't think it is a problem with MySQL as I can view the records via PHPAdmin perfectly,  just when I display them on my page I get the error.  Is there some thing I need to set in the connection?
awilde2000Author Commented:
I used this query straight after calling the connection and it now works :-)

mysql_query("SET NAMES 'utf8'");
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Dreamweaver

From novice to tech pro — start learning today.