关于php编码有关问题

WBOY
Release: 2016-06-13 13:37:48
Original
729 people have browsed it

关于php编码问题
在用php对数据库进行操作的时候,在表中添加中文的时候,数据库里却显示不出来。。。请问:
该php文件用什么编码?
数据库mysql需要设置set names gbk么?
怎么设置编码才对?菜鸟求教啦。。

------解决方案--------------------
show variables like '%char%'; 是在命令行下的么?
set names utf8 只对当前连接起作用。php程序执行完毕后连接断开就算失效了

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!