Hi friends help me to solve this problem ," display all last messages of a user from all his/her friends"
My sample message table is
--------------------------------------------------- | id | msg | sender | reciver | friend_id | --------------------------------------------------- | 1 | Hi | 1 | 2 | 1 | | 2 | Hi.. | 2 | 1 | 1 | | 3 | Hello | 6 | 1 | 3 | | 4 | What dong | 1 | 6 | 3 | ---------------------------------------------------
I need only the last message b/w the user and his friends (here consider user id is 1)
I need the result like below , please help me to achive this with mysql
--------------------------------------------------- | id | msg | sender | reciver | friend_id | --------------------------------------------------- | 4 | What dong | 1 | 6 | 3 | | 2 | Hi.. | 2 | 1 | 1 | ---------------------------------------------------
The name of this table is message..