以前我使用的是mysql,所以我迁移到mysqli,并且除向用户发出通知外,其他所有东西似乎都可以正常工作,我使用的是以下代码,并且返回的是mysqli_result类的对象无法在线转换为int >
$count_notidwt = mysqli_num_rows($get_notidwt);
这是我的代码
<?php
//getting post comment
$get_notipost = mysqli_query($conn,"SELECT * FROM post_comments WHERE posted_to='$user' AND posted_by != '$user' ORDER BY id DESC LIMIT 50");
$count_notipost = mysqli_num_rows($get_notipost);
//getting daowat comment
$get_notidwt = mysqli_query($conn,"SELECT * FROM daowat_comments WHERE daowat_to='$user' AND daowat_by != '$user' ORDER BY id DESC LIMIT 50");
$count_notidwt = mysqli_num_rows($get_notidwt);
$count = $count_notidwt + $get_notidwt;
if ($count != 0) {
//getting daowat noti
while ($noti_dwt = mysqli_fetch_assoc($get_notidwt)) {
$daowat_id = $noti_dwt['daowat_id'];
$daowat_body = $noti_dwt['daowat_body'];
$time = $noti_dwt['time'];
$user_by = $noti_dwt['daowat_by'];
$user_to = $noti_dwt['daowat_to'];
$get_user_info = mysqli_query($conn,"SELECT * FROM users WHERE username='$user_by'");
$get_info = mysqli_fetch_assoc($get_user_info);
$profile_pic_db= $get_info['profile_pic'];
$posted_by = $get_info['first_name'];
?>
感谢您的帮助。谢谢。