I am doing a pretty simple script to check if a given url exists in a database. I have checked and EVERY column, table, and the database itself is set for 'latin1_general_ci' so I don't see how it is even possible this is showing :
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (latin1_general_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='' in /home/user/public_html/checkurl.php:17
//get url passed
$url = $_GET['u'];
//dating
$stmt = $db->prepare("
SELECT *
FROM testing
WHERE url = :url
");
$stmt->execute(array(':url' => $url));
$result = $stmt->fetch(PDO::FETCH_ASSOC);
if($result)
{
$db = null;
exit("1");
}
I thought maybe this might have to do with cached queries so I reset the cache as well using RESET QUERY CACHE
, but it still occurs.