学习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
本文标题:PHP输入数据库中文乱码解决
本文链接:https://www.haomeiwen.com/subject/jsuirttx.html
网友评论