OpCrux-Server
OpCrux-Server copied to clipboard
Implement friends
Handy dandy SQL for getting friends list assuming _table ------------------- objectA | objectB
SELECT objectA AS v FROM _table WHERE objectB = ? UNION SELECT objectB AS v FROM _table WHERE objectA = ?;
What does UNION do?
Handy dandy SQL for getting friends list assuming _table
objectA | objectB
SELECT objectA AS v FROM _table WHERE objectB = ? UNION SELECT objectB AS v FROM _table WHERE objectA = ?;
The table would also contain a bool for best friend
It merges both selects. This will then give you a list of the other object where objectA = ? or objectB = ?