I'm making a social network-type web application.
I have a users
table:
___________________________________________________
|user_id|firstname|lastname|password|email|country|
---------------------------------------------------
and a contacts
table:
__________________________
|rel_id|user_id|friend_id|
--------------------------
The two tables are related on user_id.
How do I make a SQL query to retrieve all user's contacts?