This article mainly describes the actual solutions for Chinese garbled characters in phpadmin and MySQL, as well as the actual application code in related operations, the following is a detailed analysis of the Article. We hope you will have a better understanding of the actual operation steps after browsing.
Solution to Chinese garbled characters between phpadmin and MySQL:
Find the libraries folder in the Phpmyadmin folder and modify the select_lang.lib.php file.
A) zh-gb2312 modified to zh-gb2312-utf-8
B) modify the MySQL_charset_map array.
- 'Gb2312' => 'utf-8' to 'gb2312' => 'latin1 ',
(Some display 'gb2312' => 'gb2312'. The same is true)
C) modify the MySQL_charset_map array.
- 'Utf-8' => 'utf-8' to 'utf-8' => 'latin1 ',
Restart httpd.
If VertrigoServ is used, restart VertrigoServ.
MySQL garbled solution:
Add the following content to config. inc. php In the Phpmyadmin Folder: <? Php?> Between)
Configure MySQL database connection Parameters
- $db = mysql _connect("localhost", "user","password");
- mysql_select_db("message",$db);
Add the following line before executing the SQL statement.
- mysql_query("SET NAMES 'GBK'",$db);
The above content describes how to solve the Chinese garbled characters in phpadmin and MySQL. I hope it will help you in this regard.
The above content describes the solutions to Chinese garbled characters in phpadmin and MySQL. I hope you will find some gains.
Original article title: phpadmin and MySQL Chinese garbled Problem Solution
Connection: http://www.cnblogs.com/sishierfei/archive/2009/11/25/1610519.html