<?php
$path = "mysql:host=localhost;dbname=kanjisearch;charset=utf-8";
$pdo = new PDO($path, "xxx", "xxx");
$sth = $pdo->prepare("SELECT * FROM `kanji` WHERE `kanjiName` = '$kanji'");
$sth->execute();
$results = $sth->fetchAll();
?>
I am building a PHP search that uses Chinese characters in the actual SQL query, I have -> exec("SET CHARACTER SET utf8"); on the pdo. And it renders just fine, the text I bring back renders the charects great, if I put numbers ins the sql but I need to search based on the Kanji, so when I query with WHERE kanji = 一, the 一 doesn't seem to go through ok, it renders on the screen on the debug, but just wont query, results return empty but when I copy the query directly into PHPMyAdmin it returns the result.