Hi I\'m trying to make a messaging system with php and mysql.
The mysql table is simple: id sender receiver text timestamp
I\'m trying to make the messaging some
UPDAte: I'm not sure if it works perfect:
SELECT * FROM messages WHERE receiver = 13 GROUP BY receiver,sender ORDER BY timestamp DESC LIMIT 1 UNION ALL SELECT * FROM messages WHERE sender = 13 GROUP BY receiver,sender ORDER BY timestamp DESC LIMIT 1
to reverse the order:
ORDER BY timestamp DESC