0

Possible Duplicate:
MySQL Illegal mix of collations

I am implementing a query using codeigniter framework.

I always get this error "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='" When implementing this query below:

 $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();

I am very sure that my database is already set to utf8 charset and utf8_general_ci for collation and even tried utf8_unicode_ci.

I am also very sure that my database tables are also consistent to utf8 as well.

I am also very sure that utf 8 meta tags in headers are also implemented on the head tag.

Community
  • 1
  • 1
jalf
  • 555
  • 4
  • 10
  • 20

1 Answers1

0

you should try this query as the reference of this question same problem but having the charset and collations of both connection and table to latin1 , latin1_swedish_ci

$sql = "SELECT* FROM raw_customer WHERE customer_name =( _utf8 '$escape_string' )";
Community
  • 1
  • 1
M Khalid Junaid
  • 63,861
  • 10
  • 90
  • 118