Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
704 views
in Technique[技术] by (71.8m points)

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

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

POST http://vproject.dev/module/user/ign_listing 500 (Internal Server Error)

Details are:

Illegal mix of collations for operation 'like' while searching
... (u.id_user LIKE '%?°%' OR u.first_name LIKE '%?°%' OR u.last_name LIKE '%?°%' OR ue.email LIKE '%?°%' OR u.last_login LIKE '%?°%' ) ...

%?°% part changes according to the non-latin character you typed.

Any idea for solving this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I figured out the problem. It seems it is DATETIME fields that causes the problem.

.. ue.last_login '%ay?enur%' 

gives error for Illegal mix of collations for operation 'like'. When I remove LIKE partials DATETIME fields, there are no error any more. I hope this helps.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...