duanbi8529 2014-01-12 02:09
浏览 119

数据存在于我的数据库中,但PHP返回NULL

I have a weird problem for some of my rows in a specific column.

The column is named description and there are a number of entries.

When performing a query from php, I can get all of them except one (php return NULL).

In my phpmyAdmin the data for that specific is this:

μαλλον θα Ï€Ïεπει να κανουμε υπομονη μεχÏι τη δευτεÏα Ï€Î

and the structure for that column is : varchar(200), utf-general-ci

I know that this entry is Greek. But there are other Greek entries, which are visible.

My php code is this:

for quering:

$query="SELECT description,date FROM allComments p JOIN  login l ON (p.IdUser=l.IdUser) WHERE p.IdPhoto=$photo";

and for inserting data:

$query2="INSERT INTO allComments (IdPhoto,IdUser,description,dates) VALUES($photoId,$id,'$text','$date')";

What do you think might be the problem?

The entry is made correctly, since all the other columns (date for example are retrieved correctly - only this column is null)

  • 写回答

1条回答 默认 最新

  • dongxian3852 2014-01-12 02:18
    关注

    Try to set Encoding in mysqli.

    mysqli_set_charset($link, "utf8");
    

    PHP Documentation

    评论

报告相同问题?

悬赏问题

  • ¥15 请问如何在openpcdet上对KITTI数据集的测试集进行结果评估?
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路
  • ¥15 phython读取excel表格报错 ^7个 SyntaxError: invalid syntax 语句报错