Say I had a table of private messages named 'messages' with the fields, 'id', 'to', 'from', 'message' and 'dateline'. How would I construct a mySQL query that selects all rows where to is from user x and from is from user y OR to is from user y and from is from user x.
This code did not work as I tried that first
$QUERY = mysql_query("SELECT * FROM op_messages WHERE (to = '1' AND from = '6') OR (from = '6' AND to = '1') ORDER BY dateline DESC") or die (mysql_error());
Thanks.