Home > Backend Development > PHP Tutorial > 页面编码为GB2312,提交数据入库成乱码了

页面编码为GB2312,提交数据入库成乱码了

WBOY
Release: 2016-06-23 14:20:15
Original
985 people have browsed it

乱码 mysql

页面是GB2312的
入库的时候我加入了
mysql_query("set names 'gbk'")or die("设置字符库失败"); 
输出还是乱码,有没有在不调整页面编码模式的基础下其他的解决方法?

回复讨论(解决方案)

你表中字段的连接校对是什么?

你表中字段的连接校对是什么?

膜拜!才发现这个字段还需要统一为GB2312额

不一定,只要是宽字符的就可以

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template