The Illegal mix of collations (gbk_chinese_ci, IMPLI

Source: Internet
Author: User
Tags mysql tutorial

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 ."')";

Related Article

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.