try{
$db = new PDO('mysql:host=localhost;dbname=club;charset=utf-8','root',"");
$db->exec("SET CHARACTER SET utf8");
$db->exec("SET character_set_results=UTF8");
$db->exec("SET character_set_client=UTF8");
$db->exec("SET character_set_connection=UTF8");
}catch(PDOException $e){
echo $e->getMessage();
}
$query = $db->query("SELECT* from setting where id = '1'");
Date :
2014-04-16 09:43:48
By :
dreamt256
No. 3
Guest
ตรงนี้ครับ
try{
$db = new PDO('mysql:host=localhost;dbname=club;charset=utf-8','root',"");
$db->exec("SET CHARACTER SET utf8");
$db->exec("SET character_set_results=UTF8");
$db->exec("SET character_set_client=UTF8");
$db->exec("SET character_set_connection=UTF8");
}catch(PDOException $e){
echo $e->getMessage();
}
$query = $db->query("SELECT* from setting where id = '1'");
เปลี่ยนเป็น
try{
$db = new PDO('mysql:host=localhost;dbname=club;charset=utf8','root',"");
$db->exec("SET CHARACTER SET utf8");
$db->exec("SET character_set_results=UTF8");
$db->exec("SET character_set_client=UTF8");
$db->exec("SET character_set_connection=UTF8");
}catch(PDOException $e){
echo $e->getMessage();
}
$query = $db->query("SELECT* from setting where id = '1'");