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.