Mysql-about varbinary Chinese data-How to Use php to display it!

Source: Internet
Author: User
Mysql database has a field of the varbinary type, and the query result is garbled. The younger brother does not know how php can be used to display the Chinese query results normally. I would like to thank you. Ps: I'm sorry for the first question. Mysql database has a field of the varbinary type, and the query result is garbled. I don't know how php can be used. Chinese resultsNormal display.

I would like to thank you.

Ps: I'm sorry for the first question.

Reply content:

Mysql database has a field of the varbinary type, and the query result is garbled. I don't know how php can be used.Chinese resultsNormal display.

I would like to thank you.

Ps: I'm sorry for the first question.

In fact, I do not know this varbinaryz field. I checked this field to be binary.
So I created a table named test, which contains the field test1 and test1. The field type is varbinary and the field encoding is UTF-8.
Insert a piece of data using an SQL statement. test1 is Chinese.
Php code query, php file encoding is UTF-8, browser encoding is UTF-8, Chinese is displayed normally.
We recommend that you use the mysql_query ("set names UTF8") statement before the query to convert the encoding to see if it is valid.

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.