ambo Posted September 24, 2008 Share Posted September 24, 2008 Hey guys i have a login with user profile and i want to create a friends script so users can add friends Anyone know any tutorials on this or have any advice Link to comment https://forums.phpfreaks.com/topic/125555-advice-on-friends-list/ Share on other sites More sharing options...
JasonLewis Posted September 24, 2008 Share Posted September 24, 2008 If you're using MySQL as the database then it can be relatively simple. Basically you just need a new table with a primary key id which auto_increments, another int called user_id and another int called friend_id. Then when someone clicks a person to add them to their friends list, just add the users id in and the person who they want their friend to be in. When getting all friends for a user you just need to SELECT * FROM friends WHERE user_id='id'. You can even make it a bit better by adding requests, where the other person get's notified of someone adding them as a friend and they have to decide whether or not to allow it. This would be accomplished by adding another field to the table called something like 'friendship_approved'. Link to comment https://forums.phpfreaks.com/topic/125555-advice-on-friends-list/#findComment-649184 Share on other sites More sharing options...
ambo Posted September 24, 2008 Author Share Posted September 24, 2008 Thanks that is a little more clear I'll try that after work tommorow and I'm sure that I will be responding with some more questions thanks for taking the time to help me out with this project as I'm sure you are busy with your own projects -sent from my iPod Link to comment https://forums.phpfreaks.com/topic/125555-advice-on-friends-list/#findComment-649210 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.