为什么我的数据显示为问号'? “ [英] Why my data display like question marks '? '

查看:164
本文介绍了为什么我的数据显示为问号'? “的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

请帮帮我吗?

我已经安装了wamp服务器,我使用bootstrap和php处理项目,我插入的数据数据库是用波斯语写的,

但是当我在网络应用程序上检索我的记录时,它显示我就像问号我不知道该做什么?



注意:

//创建连接

Hello guys,
Please can you help me?
I have installed wamp server and I work on a project using bootstrap and php, the data which I insert into database is in Persian language,
but when I retrieve my records on web application it shows me it like question marks I don't know what to do pls??

Note:
// Create connection

$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}

$sql = "SELECT * FROM tbl";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
    // output data of each row
    while($row = mysqli_fetch_assoc($result)) {
        echo "id: " . $row["id"]. " - Name: " . $row["Name"]. "";
    }
} else {
    echo "0 results";
}





我的尝试:



我试过utf8_generial_ci,utf8_unicode_ci和utf8_persian_ci

但是我有同样的问题。



What I have tried:

I tried utf8_generial_ci,utf8_unicode_ci and utf8_persian_ci
but I have the same problem.

推荐答案

conn = mysqli_connect(
conn = mysqli_connect(


servername,
servername,


username,


这篇关于为什么我的数据显示为问号'? “的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆