php 資料庫編碼問題
Posted by ayuayu on 2014/08/12
$conn = mysql_connect(ConnectionProperty::getHost(), ConnectionProperty::getUser(), ConnectionProperty::getPassword());
mysql_select_db(ConnectionProperty::getDatabase());
mysql_query("set names utf8");
if(!$conn){
throw new Exception('could not connect to database');
}
在選擇db以後設定編碼
其他的做法莫名其妙的沒用...
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言