When phpadmin and dreamweaver test SQL commands, the question mark is displayed in Chinese. ask the php + MySql experts to solve the problem. I use wamp, apache + php + MySql uses phpadmin to tabulation for the database. in phpadmin, I have changed all character sets to gb2312.
Including the preferred parameters in the php webpage
The encoding of MySQL is also adjusted. the encoding of the database (including fields and table) is gb2312.
However, during the test, the web page still cannot display Chinese characters in the php section (displayed as question marks)
You have checked the character sets of show variables in cmd,
Run: set character_set_xxxx = gb2312;
Invalid even if all data is displayed as gb2312;
Tried to add set names gb2312 or add set names gb2312 in *. SQL, and repeatedly import and export for read/write. the error message is invalid;
I have also tried to modify default-character-set = utf8 in my. ini, which is invalid (cannot be started after modification );
It is also invalid to try to change all involved encoding to UTF-8.
How can I solve the problem?
I am a newbie, but for details. If it can be solved, I am very grateful to you for adding 100.
-------------------------
Win7x64
Apache 2.2.21
PHP 5.3.8
PHP extension: mysqli
MySQL 5.5.16
MySQL client version: mysqlnd 5.0.8-dev-20102224-$ Revision: 310735 $
PHPadmin: 3.4.5
Reply to discussion (solution)
Note that all changes to character set settings do not affect the original data in the database.
Only data after the setting is changed
1. check whether the php file is gb2312 encoded.
2. run mysql_query ("set names gb2312") before the query ");
Analysis method:
1. check whether the Chinese characters you inserted into the database are question marks. If yes, it is the problem of data insertion. run mysql_query ("set names gb2312") before running the insert statement ");
2. if the database data is normal, check whether the meta information words are correct due to incorrect page encoding. you can also directly copy the source code and meta from other places on the Internet.
3. if this problem persists, add mysql_query ("set names gb2312") before reading the data code of the database ");
I hope my answers will help you.
Although the problem has not been solved, it may be the installation path of the program. However, your answers must be crucial for subsequent solutions. Thank you very much for your answers.
Although the problem has not been solved, it may be the installation path of the program. However, your answers must be crucial for subsequent solutions. Thank you very much for your answers. Thank you for your support.