Home > Backend Development > PHP Tutorial > Solve the problem of garbled data in phpMyAdmin2.6 and above_PHP Tutorial

Solve the problem of garbled data in phpMyAdmin2.6 and above_PHP Tutorial

WBOY
Release: 2016-07-13 17:32:24
Original
883 people have browsed it

In php(as the current mainstream development language)MyAdmin2.6 and above support multi-language set, so we use php(as the current mainstream development language)When MyAdmin manages the database, the Chinese characters queried are all garbled, but there are no such problems when calling our php (as the current mainstream development language) program.
It seems that it is PHP (as the current mainstream development language) There is a problem with the configuration of MyAdmin2.6. In order to solve this problem, I searched for relevant information on Google. There are many such problems. , but there is nothing that can be solved. There is really no way. It seems that the only way to solve it is by yourself.

. . . Since the process of finding the source code was very cumbersome, I finally spent half a day and finally found a more compromise method to solve it.

Go to php

(as the current mainstream development language)

In the root directory of MyAdmin2.6, open the following file: libraries/select_lang.lib.php( As the current mainstream development language)
1. Find the line with "zh-gb2312" and change zh-gb2312 to zh-gb2312-utf-8 Why add it like this? That's because the server will filter out languages ​​without "-utf-8". In libraries/database_interface.lib.php
(as the current mainstream development language)
line 168, according to English: " To prevent confusion", :<Or if you don’t want to change zh-gb2312 to zh-gb2312-utf-8, you can remove the filtering. Just remove that if and it will be OK.

2. Find the line "$MySQL

(the best combination with PHP)

_charset_map = array(" and change gb2312 => gb2312, to gb2312 => latin1,

Save, OK, enter php

(as the current mainstream development language)

MyAdmin management, select the language chinese simplified(zh-gb2312-utf-8)Look at your Chinese data again
So, my solution is just to modify libraries/select_lang.lib.php

(as the current mainstream development language)

Just two words in this file are more convenient and faster, haha.

http://www.bkjia.com/PHPjc/508708.html

truehttp: //www.bkjia.com/PHPjc/508708.htmlTechArticleIn PHP (as the current mainstream development language) MyAdmin2.6 and above versions support multi-language sets, so When we use PHP (as the current mainstream development language) MyAdmin to manage the database,...
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