嗨,我用整理utf_unicode_ci在 mysql 中制作了我的数据库;我的代码是
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<?php
$db=mysqli_connect("localhost","saeb","123456");
if (!$db)
echo "not connected";
mysqli_select_db($db,'publisher');
$select_book="select * from books";
$result = mysqli_query($db,"$select_book");
$num=mysqli_num_rows($result);
$i=1;
while($i<=$num){
$row=mysqli_fetch_array($result);
// printf ("%s (%s)'n",$row[0],$row[1]);
echo "<br>";
echo $row['auther'];
$i++;
}
// for ($i=0; $i <$num ; $i++) {
// $row=mysqli_fetch_array($result);
// echo "<br>";
// echo $row['isbn'];
// # code...
// }
// var_dump(mysqli_get_charset($db));
?>
</html>
但我看到的是(我不知道我必须用英语执行 PHP 代码(
塞皮德南????????塔南鲍姆·阿巴斯内贾德
问题出在哪里?为什么阿拉伯语文本转换为???? ?http://axbabak.ir/uploads/ec1.pnghttp://axbabak.ir/uploads/ec2.png
在 mysqli_connect 之后做mysqli_set_charset($db, 'utf8mb4')
;
也。。只是一个猜测:尝试utf8mb4_unicode_ci
(完全支持Unicode(