PHP初学者,请教关于从数据库读取后输出会乱码的情况
目前用的wampserver
数据库选择UTF8 general_CI ,页面charset使用utf8,PhpMyAdmin中夫妻链接校对使用UTF8 GENERAL CI,
然后这段代码:
<br /><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"><br /><html><br /><head><br /><meta http-equiv="Content-Type" content="text/html; charset=utf8"><br /><title>Insert title here</title><br /></head><br /><br /> <body><br /> <p>This page uses frames. The current browser you are using does not support frames.</p><br /> <?php<br />$con= mysql_connect("localhost","root","root");<br />if(!$con)<br />{<br />die('Could not connect : ' . mysql_error());<br />}<br /><br />mysql_select_db("tes",$con);<br /><br />$result = mysql_query("select * from cat");<br /><br />while($row = mysql_fetch_array($result))<br />{echo $row['1'] . " " . $row['2'];<br />echo "Go<br/>瓦";<br />}<br />mysql_close($con)<br /> ?><br /> </body><br /><br /></html><br /><br />