View Chinese characters garbled in phpmyadmin related issues
Source: Internet
Author: User
View Chinese characters garbled in phpMyAdmin.
PHP page uses the UTF-8 encoding, the database is built using the UTF8_GENERAL_CI
But written by the PHP program in Chinese, in the phpMyAdmin is garbled, but the PHP program to read the display on the Web page, is normal.
How should be set to let write the Chinese characters in phpMyAdmin not garbled.
I have installed open source program in this environment Dizcus and WordPress, do not have this problem, so it seems, should not be phpmyadmin problem.
To find a solution??
------Solution--------------------
Before manipulating the database, add:
mysql_query ("Set names UTF8");
------Solution--------------------
The PHP program does not declare the character set to be used before writing to Chinese (set names UTF8)
------Solution--------------------
mysql_query ("Set names UTF8") each time the database is connected;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service