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
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");