In phpMyAdmin 2.6 and above, because it supports multiple language sets, when we use phpMyAdmin to manage the database, the Chinese characters queried are all garbled, but there are no such problems when our PHP program is called.
It seems that there is a problem with the configuration of phpMyAdmin2.6. In order to solve this problem, I searched for relevant information on Google. There are many such problems, but none of them can be solved. There is really no way. It seems that I can only solve it by myself. .
. . . Since the process of finding the source code was very cumbersome,
it took me half a day to finally find a more compromise method to solve it.
Go to the root directory of phpMyAdmin2.6 and open the following file:
libraries/select_lang.lib.php
1. Find the line with "zh-gb2312" and change 'zh-gb2312' to 'zh-gb2312-utf-8'
Why add this? That's because the server will filter out languages without "-utf-8", in libraries/database_interface.lib.php line 168, according to English: "To prevent confusion", :<
or if you don't put 'zh-gb2312 ' Change it to 'zh-gb2312-utf-8' to remove the filtering. Just remove that if and it will be OK.
2. Find the line "$mysql_charset_map = array(" and change 'gb2312' => 'gb2312',
Change to 'gb2312' => 'latin1',
save, OK, enter phpMyAdmin management, select language chinese simplified (zh-gb2312-utf-8)
Take another look at your Chinese data.
So, my solution is just to modify two words in the library/select_lang.lib.php file, which is more convenient and fast, haha.