php mysql search table questions.?

piki to to loss

New member
Hi,
I have run into a slight problem and was wondering if anyone could help me.
ok first off I am trying to search the table 'friendships' on my database.
in the this table there are 3 columns (sender, receiver,approved).

i have set up a search engine bases off of this website
(http://www.designplace.org/scripts.php?page=1&c_id=25)
it works well for me to enter in a simple query and get a result but this is where I run into the trouble

Out of the 3 columns table the 'sender' is the id of the person who sent the request, in the 'receive' is the person who received it, and the approved is rather or not it has been approved(yes/no).
(but i don't know who sent the request and who received it)

I want to make the search results display a list of the users friends.
on searching i have the users id stored in a cookie so i can access it.

what code could i add onto that site's code that would allow me to find out which was the user id, (out of the sender or the receiver with the approved=yes). and then how could i display each of the friend's id (remember i only have the user's id stored in a cookie)?

Also remember that there is more than one friendship on the table, and each user can have multiple friendships.


thanks for any input!
 
Back
Top