Using IF statements to display data from database

They have: 105 posts

Joined: Mar 2006

I want to allow users to view their friends in a friends list, currently they can see who they are friends with but their username is also included in the list.

For example,

In the friends table I have:

RequestId, OrignialRequestSentBy, Friend, Pending,

64564, User, Friend, n

I want to display all the friends for the user but sometimes the user was not the one who sent the original friend request, which means if I use a query to get the users friends from Originalrequestsent by OR friend the data cannot be diaplayed in one column because it shows the user who is logged in as a friend in the friends list.

which means I need to use

<?php
IF friend != user
?>

<?php
=rs("friend")
?>
which would output friends of the user and not include the username who is logged in

I would also need to use

<?php
IF originalrequestsentby != user
?>

So then I should have a list of all the friends?