mysql 保存中文
首先插入数据库要设置语言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