I need to select All messages sent by user 1 to user 2 and to know of messages sent from user 2 to user 1. I am not able to mount the SQL query for the described situation.
Message table:
IdMsg, IdUserFrom, IdUSerTo, Data, Mensagem
Sql that I use only lists the messages sent from user 1 to user 2. All attempts to know the messages sent from user 2 to user 1 that I try to do does not work Being:
$iduserfrom = 1 e IdUserTo = 2
SQL:
SELECT * FROM mensagem WHERE IdUserFrom = $iduserfrom AND IdUserTo = $iduserto