Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Illegal mix of collations
  • First of all, I have readed the following: http://dev.mysql.com/doc/refman/5.6/en/charset-collation-expressions.html, and I know that it's recommended to use a compatible collation type which will match the character set in the query.

    I am using FuelPHP 1.7 version.

    My problem is that Fuel's throwing up the following error, while trying to send a query containing special characters like łąźćęóßøñôõö:

    ERROR - 2014-08-26 21:46:05 --> Error - SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' with query: "SELECT * FROM `base`.`stream` WHERE `title` = 'sheiße' in /public_html/fuel/core/classes/database/pdo/connection.php on line 234
    The thing is - when I run exact the same query through the Navicat or MySQL command line directly, the query is running fine without any errors. Perhaps that might be the Fuel's fault?

    Regards

  • HarroHarro
    Accepted Answer
    You probably have your db config so that it sets utf8 as the charset to be used (which is the default config). This causes a SET NAMES to be executed on connect, and this is incompatible with latin1_swedish_ci.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion