The illegal mix of collations (gbk_chinese_ci, implicit) appears when saving data in the mysql tutorial)
Other such problems are easy to solve, that is, the data submitted on the page is inconsistent with the mysql field type, as long as they are unified.
Next, let's take a look at the processing method.
Using the php tutorial function iconv () function,
Gb2312 to UTF-8
$ Utf = iconv ('gb2312', 'utf-8', $ _ request ['keyword']);
Convert string UTF-8 to gb2312
$ Str = iconv ("UTF-8", "gb2312 // Transcoder", $ str );
Method 2: Modify the field encoding of the database tutorial to be consistent with that on your page.
Alter table 'category' default character set utf8 collate utf8_bin
Method 3
Modify the SQL statement to the following format:
$ SQL = "select * from {$ tablepre} members where nickname = '". $ nickname. "'"; changed
$ SQL = "select * from {$ tablepre} members where nickname = binary ('". $ nickname ."')";