Re: Displaying information from my Database
Posted: Wed Apr 18, 2012 9:56 am
Have a look at the user_friends table above
If you look at the user_frieds table user 1 is friends with user 3 and 5, user 2 is friends with users 5 and 1 and so on.
This is how I got the user's friends(but just the id's of them as in the users table) on my other page using the getFriends() method
This works correctly but only displays the user's friends id as in the user table as it should. eg If I select Peter Pan it would display Friends with: 3, 5
My problem is I need to display all the friends by there display name, I hope Im making sense...
If you look at the user_frieds table user 1 is friends with user 3 and 5, user 2 is friends with users 5 and 1 and so on.
This is how I got the user's friends(but just the id's of them as in the users table) on my other page using the getFriends() method
Code: Select all
$friends = $user->getFriends();
echo "<p>Friends with: ".implode(',',$friends). "</p>"; My problem is I need to display all the friends by there display name, I hope Im making sense...