I am receiving a "Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '='" error when executing a MySQL query in PHP. The odd thing is that the exact same query works when I run it in a phpMyAdmin window but fails when running in PHP.

The PHP query uses "User-Defined Variables" but Im not sure if that has something to do with this problem or not.

These are the settings from my server running the database:

character set client      utf8
(Global value)          latin1
character set connection  utf8
(Global value)          latin1
character set database  latin1
character set filesystem  binary
character set results     utf8
(Global value)          latin1
character set server      latin1
character set system      utf8
collation connection      utf8_general_ci
(Global value)          latin1_swedish_ci
collation database      latin1_swedish_ci
collation server          latin1_swedish_ci

I have been at this for hours and can't fix this problem. I am really not sure what to do. Do I have to modify the server settings above? My hosting provider moved me to a new server this past week and I believe that has something to do with it but I would like to know what the issue is first.

Any help and solutions would be greatly appreciated.

Thank you


Found my answer here:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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