Hi,
The problem is that sometimes the logged in user will be in friend1 or friend2 depending on who sent the friend request and I want to output only the user that is not the logged in user viewing their friends list.
When a user adds a user as a friend the user who requested the add is inserted into friend2 column, and the other user is inserted into the friend1 coloumn, pending is inserted into the status column.
When the user views their friends list, how can I output the other users usernames and not include the logged in users username in the list as well?
For example, I use this query:
PHP Code:
$query = "SELECT * FROM friends_list WHERE friend1='$_SESSION[userid]' and status='confirm' or friend2='$_SESSION[userid]' and status='confirm'";
How can I output only the other user (that is not the logged in user) from the table?
Any ideas?
Last edited by drew22299 : 04-28-2008 at 04:18 AM.
|