简体   繁体   中英

How to get all messages between sender id and receiver id on mysql?

Im making a chat application with node.js and mysql and i need to get all the data between sender id and receiver id but im stuck in that.

Need to get all the communications between these 2 id

SELECT * FROM messages WHERE (sender = '" + request.body.sender + "' AND receiver = '" + request.body.receiver + "') OR (sender = '" + request.body.receiver + "' AND receiver = '" + request.body.sender + "')"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM