phpmyadmin Chinese garbled code

王林
Release: 2023-02-27 10:10:01
Original
3420 people have browsed it

phpmyadmin Chinese garbled code

1. First, find the table you created in phpMyAdmin, such as table1 (note that the table is not a database), click "Structure" above, and find the column in which you want to save Chinese Name, such as information, click "Modify" on the right and change the sorting rule to utf8_general_ci.

PS: If you build this table first, and then modify the sorting rules of the table or the sorting rules of the external database or even the server rules according to the tutorials mentioned on the Internet, you still cannot insert Chinese characters. , it must be accurate to this field, and if you set the character set when creating the table, there is no problem.

2. Add

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Copy after login

to the head part of the html part of the page that is displayed after you run it, as shown below:

phpmyadmin Chinese garbled code

##3 . In the php part, before you insert the code into the database, add

mysql_query("set names &#39;utf8&#39;");
Copy after login
as shown in the picture:

phpmyadmin Chinese garbled code

Rerun the program and you can insert Chinese.

Recommended tutorial:

PHP video tutorial

The above is the detailed content of phpmyadmin Chinese garbled code. For more information, please follow other related articles on the PHP Chinese website!

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