When I write php today and insert data into mysql, Chinese characters or garbled characters cannot be displayed. how can this problem be solved? Character Set: mysql_query (& #39; SETNAMESutf8 & #39;); SQL statement: mysql_query (& quot; INSERTINTOuser (username) VALUES (& #39; pontong & #39;) & quot;); database table structure: usernamevarchar (20) utf8_general_ci and mysql configuration file my. I also changed it in ini, and garbled characters in the [mysql] [m mysqlphp Chinese Database
When I write php today and insert data into mysql, Chinese characters or garbled characters cannot be displayed. how can this problem be solved?
Character set already set:
Mysql_query ('set NAMES utf8 ');
SQL statement:
Mysql_query ("insert into user (username) VALUES ('pontong ')");
Database table structure:
Username varchar (20) utf8_general_ci
In addition, I also changed the mysql configuration file my. ini.
[Mysql] [mysqld] is followed
Default-character-set = utf8
How can this problem be solved?
Add:
Change the mysql encoding to gbk,
Mysql_query ('set NAMES gbk'); this line is also changed to gbk;
In phpMyadmin, Chinese characters are displayed, but Chinese characters cannot be displayed on the mysql client.