Mysql cannot search data. in a hurry, the online distress website uses UTF-8 to store data. Read data and write data using:
Mysql_query ("set names 'utf-8 '")
When searching database tables, most of them cannot be searched as long as they are Chinese.
$ Add = $ SQL-> mdenin_select ("SELECT * FROM movie WHERE 'a0 'LIKE' % $ so % 'LIMIT 0, 1000 ");
Reply to discussion (solution)
Are you using phpmyadmin? Are Chinese characters garbled?
Comment out mysql_query ("set names 'utf-8 '")
Try again
In addition, the UTF-8 character set of mysql should be utf8
Therefore, you only access the data by using the default mysql character set latin1.
Are you using phpmyadmin? Are Chinese characters garbled?
Comment out mysql_query ("set names 'utf-8 '")
Try again
This is the data saved by UTF-8, but the data cannot be searched during the search. comment out mysql_query ("set names 'utf-8'") or cannot be searched.
In addition, the UTF-8 character set of mysql should be utf8
Therefore, you only access the data by using the default mysql character set latin1.
Then how to convert the data into utf8
Read the content of the garbled field to the variable $ s
Echo base64_encode ($ s );
Post result