Join Stack Overflow to learn, share knowledge, and build your career.

Email Sign UpOR SIGN IN WITH

 Google
 Facebook
 

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?

asked Sep 5 '13 at 6:22
YahyaE

668617
 
    
One option is to use convert(datefield using utf-8)... – bbonev Jun 6 at 7:47 

3 Answers

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.

answered Sep 6 '13 at 6:10
YahyaE

668617
 
1  
Merhaba. did you fix this issue without removing DATETIME? – Rashad Sep 4 '14 at 8:23
3  
No, LIKE and DATETIME incompitablity is a MySQL problem. Hope to be fixed in later versions. – YahyaESep 4 '14 at 11:37
    
As I understand, the problem is on JSON UNICODE DECODES. So, in PHP 5.4 it should work. Did you try it at the latest PHP version? – Rashad Sep 5 '14 at 11:42
    
@RiKo You may be right. The question is one year old, so I did not try with the latest version. Let me and community know if you try and make it work. Thanks – YahyaE Sep 6 '14 at 8:33
    
@RiKo Did you try with the latest version? – YahyaE Oct 6 '14 at 17:38

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.

answered Sep 5 '13 at 6:39
doitlikejustin

5,24522955
 
    
Thanks for the knowledge but it didn't work. I think it is something about how the library handles the post data.– YahyaE Sep 5 '13 at 8:18
    
Why don't you try var_dump($this->input->post()); in your controller to see exactly what CI is doing to those chars. – doitlikejustin Sep 5 '13 at 14:57
    
I did. It is where the problem is. I am stacked with this, how come post is not utf-8? – YahyaE Sep 6 '13 at 3:16
    
The POST seems UTF-8, it is okay. Something wrong with Ignited-Datatables_ – YahyaE Sep 6 '13 at 5:03
    
Further reference [link] (github.com/IgnitedDatatables/Ignited-Datatables/issues/38) – YahyaE Sep 6 '13 at 5:05

i know that this is far too late, but, here my workaround.

SELECT * FROM (SELECT DATE_FORMAT(some_date,'%d/%m/%Y') AS some_date FROM some_table)tb1
WHERE some_date LIKE '% $some_variable %'

datetime/date column gives error for Illegal mix of collations for operation 'like', therefore, by converting it, as another table entity, previous column type will be replace with varchar type.

also, make sure to convert any column before convert it to temporary table, to make matching process more easier.

answered Aug 17 '16 at 4:15
 
    
Not in a position to test it but I liked the idea. – YahyaE Aug 18 '16 at 21:12

Your Answer

 
 
 
 
 

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged mysql codeigniter activerecord datatable or ask your own question.

asked

4 years, 3 months ago

viewed

7,928 times

active

1 year, 4 months ago

 
Work from anywhere

  • Senior Full Stack Developer
    Browzzin Pte LtdNo office location
    $40K - $60KREMOTE

    phppython

     
  • Senior/Lead Drupal (PHP) Engineer
    Compucorp Ltd.No office location
    £20K - £28KREMOTE

    phpphpunit

     
  • Director of Security
    Wikimedia Foundation, Inc.San Francisco, CA
    REMOTE

    phplinux

     
  • Software Quality Assurance Engineer
    Platform.shNo office location
    REMOTE

    qasymfony2

    High response rate

  • Work remotely - from home or wherever you choose.

    Browse remote jobs

 
Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.

Illegal mix of collations for operation 'like' while searching with Ignited-Datatables的更多相关文章

  1. mysql 客户端连接报错Illegal mix of collations for operation

    服务端用的是utf-8,客户端工具打开表和视图是会报Illegal mix of collations for operation错误,经排查,可以采用以下语句解决 SET character_set ...

  2. Illegal mix of collations for operation 'concat'

    在t_employee表中,练习使用concat函数连接字符串时, mysql> select concat('工号为:',fnumber,'的员工的幸福指数:',fsalary/(fage-2 ...

  3. mysql5.6修改字符编码,ERR:Illegal mix of collations for operation 'concat'

    mysql5.6修改字符编码,ERR:Illegal mix of collations for operation 'concat' 1.问题起因:搭建环境初始化mysql的时候看到mysql配置文 ...

  4. MySQL Error: Illegal mix of collations for operation 'concat'

    在使用concat连接字符串时出现错误:MySQL Error: Illegal mix of collations for operation 'concat' 原因:字段操作默认为UTF8的编码, ...

  5. 错误之Illegal mix of collations for operation 'like'

    内容来自博客:https://www.cnblogs.com/install/p/4417527.html MySQL Illegal mix of collations for operation ...

  6. myslq数据库用union all查询出现 #1271 - Illegal mix of collations for operation 'UNION'

    出现 #1271 - Illegal mix of collations for operation 'UNION' 的原因是两个字符编码不匹配造成的. 我遇到的是  utf8_general_ci ...

  7. mysql提示:Illegal mix of collations for operation ‘UNION’

    http://www.111cn.net/database/mysql/56096.htm show variables like "%char%"; show variables ...

  8. 有关mysql的utf8和utf8mb4,以及Illegal mix of collations for operation 'like'

    参考以下几个帖子: https://www.cnblogs.com/install/p/4417527.html https://blog.csdn.net/Yetmoon/article/detai ...

  9. Mysql Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='

    MySQL字符串比较bug: select * from table_a a left join table_b b on a.field_a = b.field_b   error: Illegal ...

随机推荐

  1. ps cs6破解

    http://www.cnit618.com/html/rjxz/yyrj/3011.htm 这个破解方法太简单.注:文中最后给出补丁.我用了方法二破解:代替amtlib.dll.一下子就可以.

  2. [UOJ198][CTSC2016]时空旅行

    uoj description 你要维护若干个集合,每个集合都是有一个编号比他小的集合扩展而来,扩展内容为加入一个新的元素\((x,c)\)或者删除一个已有元素.集合的扩展关系之间构成一个树形结构. ...

  3. juqery学习3之juqery对象条件筛选

    代码例子:某个div块下的字体样式的控制. //script代码 <script src="${sitePath}/cec_wcp/js/jquery-1.8.2.min.js&quo ...

  4. 洛谷 P1039侦探推理

    /* 枚举罪犯和星期几,那么所有人说的话是真是假一目了然. 首先一个人不能既说真话又说假话. 即: I am guilty. I am not guilty. 因为非真即假,所以直接判断impossi ...

  5. Linux下定时切割Mongodb数据库日志并删除指定天数前的日志记录

    此为在网络上找来的,觉得很好! 实现目的: 对Mongodb数据库日志按天保存,并且只保留最近7天的日志记录. 具体操作: 使用Mongodb数据库自带的命令来切割日志 ps -def | grep ...

  6. 设计模式(Python)-单例模式

    本系列文章是希望将软件项目中最常见的设计模式用通俗易懂的语言来讲解清楚,并通过Python来实现,每个设计模式都是围绕如下三个问题: 为什么?即为什么要使用这个设计模式,在使用这个模式之前存在什么样的 ...

  7. 说说 PADS Layout 中的第 20 层和 第 25层

    说说 PADS Layout 中的第 20 层和 第 25层 PADA Layout 有一个不成文的说明,第 20 层和第 25 层各有各的用途. 第 20 层是 Placement Outline ...

  8. linux中查看nginx、apache、php、mysql配置文件路径的方法

    如何在Linux中查看nginx.apache.PHP.MySQL配置文件路径了,如果你接收一个别人配置过的环境,但没留下相关文档.这时该怎么判断找到正确的加载文件路径了.可以通过以下来判断1.判断a ...

  9. Air test 基于屏幕比例实现滑动的方法

    # -*- encoding=utf8 -*- __author__ = "chenshanju" __docs__ = "基于iOS类实现滑动" from a ...

  10. springboot的interceptor(拦截器)的应用

    一.SpringMVC 中的Interceptor 拦截器也是相当重要和相当有用的,它的主要作用是拦截用户的请求并进行相应的处理.在web开发中,拦截器是经常用到的功能.它可以帮我们验证是否登陆.预先 ...