lundi 28 décembre 2015

Retrieve data from User table based on the id from Friends Table

I am having 2 tables Users and Friends.

Users Table fields(id,username, password, fname, lname, nickname,etc.,)

Friends Table fields(id, user_id, friend_id)

Now problem is i am trying to access user data based on friends table friends_id.

mysql query is :

SELECT *
FROM Users
inner JOIN Friends
ON Users.ID=Friends.Friend_ID;

but need only user data.

Aucun commentaire:

Enregistrer un commentaire