Illegal mix of collations for operation 'like' while searching with Ignited-Datatables

后端 未结 5 573

I have successfully implemented Ignited-Datatables. However, while searching with database when typing \"non-latin\" characters like \"İ,ş,ğ,..\"

POST http://v

5条回答
  •  不思量自难忘°
    2020-12-06 07:17

    Try the following:

    u.id_user LIKE '%İ%' OR ... OR ... '%İ%' COLLATE utf8_bin
    

    Refer to MySQL Unicode Character Sets

    Also you can refer to MySQL _bin and binary Collations for more information on utf8_bin:

    Nonbinary strings (as stored in the CHAR, VARCHAR, and TEXT data types) have a character set and collation. A given character set can have several collations, each of which defines a particular sorting and comparison order for the characters in the set. One of these is the binary collation for the character set, indicated by a _bin suffix in the collation name. For example, latin1 and utf8 have binary collations named latin1_bin and utf8_bin.

提交回复
热议问题