Jump to content
×
×
  • Create New...
  • 0

Sort the last message


Question

Hello guys how we can sort the messages correctly by last msg in privat_notify.php

userA to userB : hey  time 15:20

userA to userC:  hey time 15:21  this message to up

shortly : like all messengers in another chats...

i dont understand why its so complex in codychat

 

 $private = $mysqli->query("
    SELECT count(*) as private_count, MAX(a.time) AS time, a.hunter, b.last_action, b.user_id, b.user_name, b.user_color, b.user_tumb, b.user_status, b.user_isverified from boom_private a inner join boom_users b on a.hunter = b.user_id 
    WHERE status = 0 AND target = {$data['user_id']} 
    GROUP BY hunter,user_id,user_name,user_color,user_tumb,last_action
    ORDER BY a.time DESC
");

 

   $get_other = $mysqli->query("
        SELECT MAX(a.time) AS time, a.hunter, b.last_action, b.user_id, b.user_name, b.user_color, b.user_tumb, b.user_status, b.user_isverified FROM boom_private a
        INNER JOIN boom_users b ON a.hunter = b.user_id
        WHERE target = {$data['user_id']} AND status < 3 AND hunter != '{$data['user_id']}' $add_not
        GROUP BY hunter,user_id,user_name,user_color,user_tumb,last_action
        ORDER BY a.time DESC
    ");

 

please help me..

Edited by Fonex
Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

Important Information

Terms of Use