$connect=mysql_connect("localhost","root","",true);
$db=mysql_select_db("test",$connect);
mysql_query("set names utf8");
$connect2=mysql_connect("localhost","root","",true);
$db2=mysql_select_db("test",$connect2);
mysql_query("set names gbk");
转载于:https://my.oschina.net/shunshun/blog/185168