请帮分析下 数据库里查出来的中文信息乱码原因。
<html><head>
<title>MySql数据库测试信息...
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<style type="text/css">
body {font-size:12px}
td {font:12px}
</style>
<?php
if(isset($_POST[host])){//提交了
$db_lk=@mysqli_connect("$_POST[host]","$_POST[loginuser]","$_POST[loginpw]");
if($db_lk){
if(mysqli_select_db($db_lk,$_POST[usedb])){//mysqli_select_db($conn,"sdm168070332_db");
$msg="服务器连接成功!<br>数据库使用成功..";
$chemsql="select c.*,i.dept '部门',sum(i.numbers)-sum(o.numbers) as '结余' from table_chem c join table_chemin i on c.chemnameid=i.chemnameid
join table_chemout o on i.chemnameid=o.chemnameid group by c.chemnameid,i.dept";
$result=mysqli_query($db_lk,$chemsql);
echo "<pre>";
print_r(mysqli_fetch_assoc($result));
echo "</pre>";
echo "my gold 我的天啊!!!乱码怎么办!!!";
/* <table>
<tr>化学名称<th>ID</th><th>单位</th><th>部门</th><th>结余</th></tr>
while($row=mysqli_fetch_object($result)){
echo "<tr>";
echo"<td>".$row->'c.chemname'."</td>";
echo"<td>".$row->'c.chemnameid'."</td>";
echo"<td>".$row->'c.unit'."</td>";
echo"<td>".$row->'i.dept'."</td>";
echo"<td>".$row->balance."</td>";
echo"</tr>";}
</table>
*/
mysqli_close($db_lk);
}else{
$msg="服务器连接成功!<br>数据库使用失败..";
}
}else{
$msg="服务器[$_POST[host]]连接失败!<br>错误代号:".mysqli_errno()."<br>错误信息:".mysqli_error();
}
}else{
$msg="未进行连接测试...";
}
?>
<body bgcolor="#FFFFFF">
<form name="form1" method="post" action="">
<div align=center id="layer1">
<table width="300" border="0" align="center" cellpadding="3" cellspacing="0" bordercolor="#996699" bgcolor="#CCCC99">
<tr>
<td ><p>主机</p></td>
<td><input name="host" type="text" id="host" value="<?=$_POST[host]?>" ></td>
</tr>
<tr>
<td>连接帐户</td>
<td><input name="loginuser" type="text" id="loginuser" value="<?=$_POST[loginuser]?>" onkeyup="this.form.usedb.value=this.value+'_db'"></td>
</tr>
<tr>
<td>连接密码</td>
<td><input name="loginpw" type="password" id="loginpw" value="<?=$_POST[loginpw]?>"></td>
</tr>
<tr>
<td>使用数据库</td>
<td><input name="usedb" type="text" id="usedb" value="<?=$_POST[usedb]?>"></td>
</tr>
<tr>
<td> </td>
<td><input name="cmdSubmit" type="submit" id="cmdSubmit" value=" 送出 "></td>
</tr>
</table>
<div>
</form>
<p align=center><?=$msg?></p>
</body>
</html>