Illegal mix of collations in mysql + codeigniter 在mysql和codeigniter中出现了字符集的非法混合。
Illegal mix of collations in mysql + codeigniter 在mysql和codeigniter中出现了字符集的非法混合。
我正在使用CodeIgniter框架实现一个查询。
在实现下面的查询时,我总是遇到这个错误:“Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='”:
$customer_name = "orduña's"; $escape_string = mysql_escape_string($customer_name); $sql = "SELECT* FROM raw_customer WHERE customer_name ='$escape_string'"; $query = $this->db->query($sql); return $query->row_array();
我非常确定我的数据库已经设置为utf8字符集和utf8_general_ci排序规则,甚至尝试了utf8_unicode_ci。
我也非常确定我的数据库表也一致使用utf8。
我也非常确定头部标签中已经实现了utf8的元标签。