Jump to content

Help With a Script


ambo

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.