Table1
user,city
Table2
user,friends
I want to select * from Table1 for one specific user and all his friends (who are also users in Table1).
Tried this and it found all data but gave multiple rows for WHERE Table1.user = '$user' even though every username is unique.
SELECT *
FROM Table1, Table2
WHERE Table1.user = '$user'
OR
(Table2.user = '$user' and Table2.friends = Table1.user)
Many thanks
You essentially have two different queries (select user 1’s info, select user 1’s friends’ info). You can combine them with a UNION.