Jump to content

not able fetch results from tables


shan2batman
 Share

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());

 

Edited by shan2batman
Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.