当我运行这样的PHP查询时,我无法从Mysql服务器接收数据:
$mysqli->query("utf8_general_ci"); // I have tried "UTF8" - Didn't work
$query = "SELECT * FROM graf WHERE onoma LIKE 'ΓΕ%' ";
$mysqli->query("SET CHARACTER SET 'utf8_general_ci'");
$result = mysqli_query($mysqli,$query);
if ($result !=0)
{
while ($row = mysqli_fetch_assoc($result))
{
echo $row['onoma'];
}
}
echo mysqli_error($mysqli); //gives no error
echo mysqli_sqlstate($mysqli); //gives 00000 which means the statement is correct
有人可以帮忙吗?提前谢谢你,
答案 0 :(得分:0)
尝试使用以下内容设置php内容类型:
header('Content-Type: text/html; charset=utf-8');