Jump to content

duplicated AND OR selectors


soltek

Recommended Posts

Hello, I'm trying to code a private message system and got stuck (yup, again) on this part:

 

At the page where the messages are read, I'd like to display all the messages where the same sender and the receiver participate, like this:

 

SELECT * FROM messages WHERE sender = 1 AND receiver = 2 OR sender = 2 AND receiver = 1 ORDER BY date LIMIT 0,10;

 

Is there anyway to do something like that?

Thank you.

 

(Again, sorry for the weird Subject, I gave my best)

Link to comment
https://forums.phpfreaks.com/topic/223103-duplicated-and-or-selectors/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.