问题描述:mysql下的数据的的确确为中文数据,但是用mysqli读取显示成问号?
百度了很久,各种描述都没有正确得到解决,最终查看官方文档成功解决!
数据库内容:
网页显示:
查看手册说明
Use difference collation/character for connect, result.
You can set the collation before your query.
E.g. want to set the collation to utf8_general_ci
you can send the query "SET NAMES 'utf8'" first
<?php
$mysqli=new mysqli('localhost', 'root', 'password', 'test');
$mysqli->query("SET NAMES 'utf8'");
$q=$mysqli->query("select * from test");
w