Search code examples
mysqlcodeigniteractiverecorddatatable

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?


Solution

  • 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.