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

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

这是啥
这是啥

Antworte allen(2)
数据分析师

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

围观一下哦,学习一下。

刘奇

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

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

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


Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage