学习PHP技术
mysqli乱码解决办法:
$mysqli = new mysqli('localhost','root','password','dbname');//mysqli链接数据库的写法
$mysqli->query("SET NAMES utf8");//方法1
$mysqli_query($db,"SET NAMES utf8");//方法2
学习PHP技术
mysqli乱码解决办法:
$mysqli = new mysqli('localhost','root','password','dbname');//mysqli链接数据库的写法
$mysqli->query("SET NAMES utf8");//方法1
$mysqli_query($db,"SET NAMES utf8");//方法2