編碼的MySQL數據我有以下PHP代碼:PHP讀取utf8_unicode_ci
<?php
mysql_connect("localhost","root","*****");
mysql_select_db("MyData");
$sql=mysql_query("select * from menu");
while($row=mysql_fetch_assoc($sql))
$output[]=$row;
print(json_encode($output));
mysql_close();
?>
我的數據的基礎上被編碼上utf8_unicode_ci。 所以當我在瀏覽器中讀取輸出時,拉丁字符呈現得很好,但是希臘字符顯示爲「???????」。當我從我的數據庫讀取數據時,會定期呈現。 有人可以幫我介紹一下我的php代碼有什麼用?
重複搜索它 – dynamic 2011-05-27 15:22:29
可能重複[MySQL更改編碼後拋出錯誤](http://stackoverflow.com/questions/6097364/mysql-throws-error-after -changing-encoding) – Johan 2011-05-27 15:28:17