ambo Posted September 18, 2008 Share Posted September 18, 2008 im working on a social networking script and right now i have a basic login and when they login they can view a little about there selfs I want to create a friends list like in myspace or face book just something simple where they can search or view and then add to friends list. does anyone know where i can find a tutorial for this ive been looking or if someone has a script i can write it off of. ??? Link to comment https://forums.phpfreaks.com/topic/124793-help-with-a-script/ Share on other sites More sharing options...
aebstract Posted September 18, 2008 Share Posted September 18, 2008 Well if you have logging in and I am guessing also a way to sign up, you have enough knowledge of mysql and how to work with your database, correct? You can do it a few ways, I'll explain two ways and you can choose one of them if you want to try that way; 1: You can add a column to your users information in the database called `friends` or something, then you can write the friends' unique id or something of that sort in to this column, separate each by a comma or something and you can run an array from it. I suck at arrays so I probably wouldn't do this, doesn't mean it's bad. 2: You could set up another table for friends' lists: Basically each row has an id, user_id, and friend_id. Set the user id to the id of the person logged in and the friend id to their friend, then when you want to display the friends list, just pull all of friend_id for whoever is logged in, ie: user_id Hopefully this makes sense? Link to comment https://forums.phpfreaks.com/topic/124793-help-with-a-script/#findComment-644656 Share on other sites More sharing options...
ambo Posted September 18, 2008 Author Share Posted September 18, 2008 with option 2 I think that would be the best way because i am going to be adding a users avitar photo for there profile that way i can make it so when it displays friends it will show there picture also Link to comment https://forums.phpfreaks.com/topic/124793-help-with-a-script/#findComment-644659 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.