[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!