Hello.
I am coding a friendship system and it has two tables.
members
- id
- username
- password
friends
- id
- user_id
- friend_id
- status
Let's say that i want a query that can select the friends IDs of the member $userId how possible to make this in one query?
I found a solution which is to make 2 queries. The fist selects the friends WHERE user_id = $userId
AND the second selects friends WHERE friend_id = $userId
and then MIX them in one array. If there is no other solution I'm going to use it.
please any ideas for both the SQL structure & Queries?