首先插入数据库要设置语言utf8
$mysqli = new MySQLi('localhost','root','***','edu');
$mysqli -> query("set names utf8");
$sql = "insert into user (cname,uname) values ('$cname','$uname')";
$mysqli -> query($sql);
在phpmyadmin中设置保存为utf8_unicode_ci
首先插入数据库要设置语言utf8
$mysqli = new MySQLi('localhost','root','***','edu');
$mysqli -> query("set names utf8");
$sql = "insert into user (cname,uname) values ('$cname','$uname')";
$mysqli -> query($sql);
在phpmyadmin中设置保存为utf8_unicode_ci
转载于:https://www.cnblogs.com/rlm0909/p/3447165.html