I have table for messages which contains id, sender_id, receiver_id, message and conversation_id
(I connected them by conversation_id, which they make by sending first message and if someone is replying, first he search conversation_id from messages where he is receiver and guy where is he replying is sender and by that send message with same conversation_id)
Now in messages list I want to output one just one last row per different conversation_id where sender_id='$my_id' OR receiver_id='$my_id'
I am using DISTINCT but I get all rows always as output:
SELECT DISTINCT conversation_id, sender_id, message
FROM messages
WHERE receiver_id='$my_id'
ORDER BY id DESC
LIMIT 1bro. - Peter Chaulaid? - 1000111