I have the following query. It works fine if I execute it in MySQL. But when I call it from my PHP program it give me this error:
[PDOException]
SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_unicode_ci,COERCIBLE) for operation '='
This is the query:
SELECT * FROM tab
WHERE Time >= UTC_TIME
AND Time < TIME( DATE_SUB( UTC_TIMESTAMP() , INTERVAL -5 MINUTE ))
AND Enabled =1
AND (
LastTimeStamp IS NULL
OR DATE( LastTimeStamp ) != DATE(UTC_TIMESTAMP())
)
AND d = (
SELECT d
FROM days
WHERE DayName = (
SELECT DAYNAME(UTC_TIMESTAMP()))
)
Also both the tab and the days have latin1_sweedish_ci
collation.
Can some one help me? I am using Laravel framework for my application.