Jump to content

not able fetch results from tables


shan2batman

Recommended Posts

@Barand i changed the query to something below but still the problem still it is not fetching results

 

$query="select private_message.receiver,pm_notifications.message_id,pm_notifications.user_id_pm,user.user_id,user.avatar from pm_notifications"
        . " inner join private_message"
        . " on private_message.os_id=pm_notifications.os_id_pm"
        . " inner join user"
        . " on user.user_id=pm_notifications.user_id_pm"
        . " where private_message.receiver=:sess_id"
        . " and private_message.sender=:f_uname and pm_notifications.status=:status and pm_notifications.receiver=:f_uname"
       . " order by pm_notifications.pm_notification_id  desc" ;
//var_dump($query);
$status='not_seen';


$stmt_pm_f=$conn->prepare($query);
$stmt_pm_f->bindValue(":f_uname", $friend_username);
//$stmt_pm_f->bindValue(":f_uname1", $friend_username);
//$stmt_pm_f->bindValue(":sess",$_SESSION['id']);
$stmt_pm_f->bindValue(":sess_id",$_SESSION['uname']);
$stmt_pm_f->bindValue(":status",$status);
$stmt_pm_f->execute();
$results_pm_f=$stmt_pm_f->fetchAll();
$total_row_f=$stmt_pm_f->rowCount();
var_dump($results_pm_f);
var_dump($stmt_pm_f->rowCount());

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.