What\'s the best, and easiest way to do this? My query currently is:
SELECT * FROM chat WHERE (userID = $session AND toID = $friendID) OR (use
If you want the last 10 then just change ASC to DESC
SELECT * FROM chat WHERE (userID=$session AND toID=$friendID) OR (userID=$friendID AND toID=$session) ORDER BY id DESC LIMIT 10