[Help] phpmyadmin. The Chinese character field is changed to a question mark.

Source: Internet
Author: User
[Help] phpmyadmin. The Chinese character field is changed to a question mark. Reply to discussion (solution)

It may be the encoding of the insert data. you can check whether this is the case on the cmd interface. if so, it is likely that the encoding at the time of receiving the data is inconsistent with the database encoding.

If you want to change the encoding of the page, try again.

The page is UTF-8 .. On the page, you can still view Chinese characters. it is changed to a question mark only in phpmyadmin .. What is the cmd page ??

I just read it. what other tables contain Chinese characters ??

Change the page encoding to gbk. you can also go to mysql under dos to check whether the page encoding is garbled.

Everything comes from not executing mysql_query ('set names utf8 ');

Mysql_query ('set names utf8'); can I add this sentence to the file header? What are the specific values ??

Mysql_query ('set names utf8'); can I add this sentence to the file header? What are the specific values ??
$ Conn = @ mysql_connect ('localhost', 'root', '') or die ('could not connect: '. mysql_error ());
Mysql_select_db ('test', $ conn );
Mysql_query ("set names 'gbk'"); // add this parameter.

Check your database code.

I can see a set encoding for database configuration. I have already set the encoding. Do I need to add this sentence? Or is the problem somewhere else?

This is my local test. the Chinese characters can be displayed normally.

The problem is solved, not encoding. it is because the character set of the database is incorrect. Thank you!

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.