Messaging System with PHP/MySQL -
hi i'm trying make messaging system php , mysql.
the mysql table simple: id sender receiver text timestamp
i'm trying make messaging facebook/twitter list in 'conversations' , last message in conversation viewed.
this have atm:
(select * messages receiver = 13 or sender = 13 group receiver,sender order id asc) order id asc
select messages.* messages, (select max(id) lastid messages receiver = 13 or sender = 13 group concat(least(receiver,sender),'.',greatest(receiver,sender))) conversations id = conversations.lastid order timestamp desc
what need unique conversation id between chat-partners. i've simulated subquery, hope helps
Comments
Post a Comment