I am trying to make an inbox section of messages. My problem goes like this.
id userfrom userto
1 a b
2 b a
now i have to select only one message of conversation between a and b.I have also tried some mysql queries like this one
$query="select *
from messages
where userfrom='a' || userto='a'
group by userto
order by id desc"
but it shows both messages of conversation but i only want to show only one message of the conversation