I have the following table. It stores messages that each user has sent and received in chats. I want to select all the messages that a user has sent and received and retrieve them. I can then sort them by their conversation id in JQUERY. Would I have to do two queries for this or can I embed a query? Essentially what I want to do is
SELECT * FROM chatbox WHERE sender=?
and
SELECT * FROM chatbox WHERE receiver=?
I just want to try to avoid having two queries and two while loops for the results. Anyone have any suggestions?
1 Answer