Novice ask, very simple, is about the Chinese garbled problem

Source: Internet
Author: User
The problem is, rookie I inserted data on MySQL Workbench, and then use PHP to extract the data display, but the browser to see the Chinese garbled problem.
PHP is encoded on a notepad++ utf-8 without a BOM.
Then the charset of the database is this:

Tried in Set names Utf8,set,alter table name convert to character set UTF8, in the browser Chinese is displayed????, ask


Reply to discussion (solution)

After selecting a database, execute the setnames UTF8 directive
Assuming that you are using the MySQL extension, then
mysql_query (' Set names UTF8 ');

After selecting a database, execute the setnames UTF8 directive
Assuming that you are using the MySQL extension, then
mysql_query (' Set names UTF8 ');


Sorry, I do not seem to understand, where to plug in, how to plug all the wrong

I don't know, I shouldn't have put your code out.
I already said: After selecting the database

You have code similar to the following
Mysql_connect ();
mysql_select_db (' XXX ');
mysql_query (' Set names UTF8 '); Right here, set the working character set.

I don't know, I shouldn't have put your code out.
I already said: After selecting the database

You have code similar to the following
Mysql_connect ();
mysql_select_db (' XXX ');
mysql_query (' Set names UTF8 '); Right here, set the working character set.


Thank you moderator, every time you have a warm-hearted answer, has been successful, although do not know what the principle is, and heard to do so every time. That's a little bit of an egg ache.

What is the principle?
Very simple, I use Chinese, you use Japanese, we will not be able to communicate
Now I tell you: you ask a Chinese translation
So we can communicate.

The moderator's answer was so subtle that his profound questions were popularized, high

What is the principle?
Very simple, I use Chinese, you use Japanese, we will not be able to communicate
Now I tell you: you ask a Chinese translation
So we can communicate.

  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.