gpt4 book ai didi

php - PHP 中的希腊字符

转载 作者:行者123 更新时间:2023-11-30 01:26:07 26 4
gpt4 key购买 nike

当我运行这样的 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

有人可以帮忙吗?预先感谢您,

最佳答案

尝试使用以下命令来设置 php 内容类型:

header('Content-Type: text/html; charset=utf-8');

关于php - PHP 中的希腊字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17975499/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com