加入header("content-type:text/html; charset=utf-8");echo不乱码,但是数据库查询就乱了,怎么办?
这是啥
这是啥 2017-02-21 13:28:25
0
2
1087

加入header("content-type:text/html; charset=utf-8");echo不乱码,但是数据库查询就乱了,怎么办?

这是啥
这是啥

reply all(2)
数据分析师

Add header("content-type:text/html; charset=utf-8"); the echo is not garbled, but the database query is messed up. What should I do? -PHP Chinese website Q&A-Add header("content-type:text/html; charset=utf-8"); the echo is not garbled, but the database query is messed up. What should I do? -PHP Chinese website Q&A

Let’s take a look and learn.

刘奇

在你链接数据库的下方加入查询数据库指定编码 ,向下面这样

$link = mysqli_connect('localhost','root','密码','数据库名') ;

$link->query("SET NAMES utf8");


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template