Home > Backend Development > PHP Tutorial > Solution to Chinese garbled code in php connection to mysql

Solution to Chinese garbled code in php connection to mysql

WBOY
Release: 2016-07-25 08:52:19
Original
1016 people have browsed it
This article introduces the solution to Chinese garbled characters when PHP connects to MySQL data. Friends in need can refer to it.

Solution to Chinese garbled characters:

1. When creating the database, select utf-8 encoding

2. Select UTF-8 encoding when creating php files

3. Prevent garbled characters during data transmission

mysql_query('set names utf8');

4. Add: to the static page:

Generally, if the above four points are set, there will be basically no problem.



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