解决乱码

class Tool
{

static public function getLink(){
$link = new mysqli('localhost','root','','shop');

if(mysqli_connect_error()) {
echo 'Could not connect to database.';
exit;
}
$link->query("set names gbk");
return $link;
}
}
posted @ 2015-12-18 09:52  冰灬两重天  阅读(93)  评论(1编辑  收藏  举报