About the problem of garbled characters in Mysql5_PHP tutorial

WBOY
Release: 2016-07-13 17:37:33
Original
789 people have browsed it

I have been exposed to Mysql5 several times before, but I have been using 4.0 because the Chinese garbled characters cannot be solved. Mysql5 supports multiple encoding methods. As long as the encoding stored and read are consistent, garbled characters will not be generated, for example, both are gb2312.
1. Specify the encoding gb2312
in the web page
It is best to execute it before executing the SQL statement:
mysql_query("SET NAMES GB2312");


2. Modify the apache configuration file httpd.conf
AddDefaultCharset GB2312
3. Modify mysql5 configuration file
default_character_set = gb2312

This method was successfully tested under FC5 and Windows XP.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486548.htmlTechArticleI have been exposed to Mysql5 several times before, but I have been using 4.0 because the Chinese garbled characters cannot be solved. mysql5 supports multiple encoding methods. As long as the encoding stored and read are consistent, garbled characters will not be generated, such as...
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