数据库里的数据是中文的 php查询数据库并在网页输出时出现乱码
sql连接数据库后 紧跟设置编码格式为utf-8
设置一下输出的编码,和页面一致就行。
$conn=mysqli_connect("localhost","root","rootroot","shop_db");
$conn->query("set names utf8");
$sql = "select * from orderinter where flag=0 order by id limit 1";
类似于这种。。
输出编码没有设置。。
保持编码一致就可以了!