Jump to content
MakeWebGames

Recommended Posts

Posted

Ok.. I am trying to implement friends system. Where you have to send reqyest ti become friends, and it then can be accepted or declined..

I have a good idea how I will make the request/accept/deny system. But not how to make table for actuall friends list.

So:

if(accept_invitation)

{

what here?

my idea:

mysql_query(INSERT INTO friends (ID1,ID2))

mysql_query(INSERT INTO friends (ID2,ID1))

}

then generate the friends list

$friends=mysql_query(SELECT * FROM friends WHERE ID1=$_SESSION['userid'])

while($f=mysql_fetch_assoc($friends))

{

$name=mysql_query(SELECT userame FROM users WHERE userid=ID2)

echo"$name['username']"

}

I hope yous can get the idea from the mock up code what im thinking of doing.. And can make some comments wether its the good way, or is there bettter ways??

Posted

Well I just thought since there was no solution in it, yous mught as well :)

Well if yous dont... Maybe when I will have time ill explain how I did, maybe it will help someone else :D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...