Php 如何解决从ms access到mysql的数据传输中的阿拉伯语编码问题?
我尝试将阿拉伯语数据从MS Access传输到MySQL,并使用datatables API将其显示在php页面上。我的代码就是这样的:Php 如何解决从ms access到mysql的数据传输中的阿拉伯语编码问题?,php,mysql,ms-access,Php,Mysql,Ms Access,我尝试将阿拉伯语数据从MS Access传输到MySQL,并使用datatables API将其显示在php页面上。我的代码就是这样的: <meta http-equiv="Content-Language" content="ar-lb"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <?php ini_set('default_charset', 'UTF-8'); $
<meta http-equiv="Content-Language" content="ar-lb">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php
ini_set('default_charset', 'UTF-8');
$servername = "localhost";
$username = "root";
$password = "0000";
$dbname = "mysqlcompdb";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
mysqli_set_charset($conn,"utf8");
$query ="SELECT pername,MOBIL_NO,PC_NAME,PC_STYLE,listno,amount,salepric,PC_ITMNO FROM inquiryrep";
$result = $conn->query($query);
?>
<!DOCTYPE html>
<html>
<head>
<title>تقرير متابعة الزبائن</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" />
<h1 align="center">تقرير متابعة الزبائن</h1>
</head>
<body>
<div class="container">
<div class="table-responsive">
<table id="followup" class="table table-striped table-bordered" >
<thead>
<tr>
<td>رقم الموبايل</td>
<td>سعر البيع</td>
<td>العدد</td>
<td>رقم القائمة</td>
<td align="right">الموديل</td>
<td align="right">اسم المادة</td>
<td>رمز المادة</td>
<td align="right">اسم الزبون</td>
</tr>
</thead>
<?php
while($row = mysqli_fetch_array($result))
{
echo '
<tr>
<td><a href="tel:'.$row["MOBIL_NO"].'">'.$row["MOBIL_NO"].'</a></td>
<td>'.number_format($row["salepric"]).'</td>
<td>'.$row["amount"].'</td>
<td>'.$row["listno"].'</td>
<td align="right">'.$row["PC_STYLE"].'</td>
<td align="right">'.$row["PC_NAME"].'</td>
<td>'.$row["PC_ITMNO"].'</td>
<td align="right">'.$row["pername"].'</td>
</tr>
';
}
?>
</table>
</div>
</div>
</body>
</html>
<script>
$(document).ready(function(){
$('#followup').DataTable( {
responsive: true
} );
});
</script>
تقرير متابعة الزبائن
تقرير متابعة الزبائن
رقم الموبايل
سعر البيع
العدد
رقم القائمة
الموديل
اسم المادة
رمز المادة
اسم الزبون
$(文档).ready(函数(){
$(#followup')。数据表({
回答:对
} );
});
我在有阿拉伯语数据的字段中得到了这个。所有排序规则都设置为utf8\U general\U ci,服务器字符集:UTF-8 Unicode(utf8)
我希望你们能得到所有必要的信息来帮助我解决这个问题。我没有更多的想法,但是
确认两侧字符集都是utf8\u general\u ci
(应该是相同的)。如果在创建表utf8\u general\u ci
后发生了更改,因此无法工作,请重新创建mysql选项卡