Jump to content

a system for friends


ellvini

Recommended Posts

i have a membersystem but ow i want that you can add your friends :P like netlog you can refuse or stop the friendship have some one some ideas ?

 

Have you programmed your own member system? You can simply set up a form where a user can send an 'invite', which will go into a user's table. If the user's table has an invite, it can display it. If they accept using the form, It can send their userID into the other user's 'friends' table.

 

Seems pretty straightforward.

Link to comment
Share on other sites

It is not that simple because :P you have a lot of factors like how i am goning to display it and yes i have maked my own membersystem

 

..I never said it was that simple. To display the user's friends, Retrieve the aformentioned table, parse the ID's and list the friends however you like.

Link to comment
Share on other sites

CREATE TABLE users (
  users_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
  users_username VARCHAR(16) NULL,
  users_password VARCHAR(40) NULL,
  PRIMARY KEY (users_id)
);

CREATE TABLE followers (
  followers_followee SMALLINT UNSIGNED NOT NULL,
  followers_follower SMALLINT UNSIGNED NOT NULL,
  PRIMARY KEY (followers_followee, followers_follower)
);

CREATE TABLE tweets (
  tweets_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
  tweets_users_id SMALLINT UNSIGNED NOT NULL,
  tweets_tweet VARCHAR(140) NULL,
  tweets_tweet_date TIMESTAMP NULL,
  PRIMARY KEY (tweets_id, tweets_users_id)
);

 

SELECT tweets_tweet
FROM followers, tweets
WHERE tweets_users_id = followers_follower
AND followers_followee = 1

 

This example features tweets but it can be modified to meet your needs (followers) in this example defines the relationship between two friends.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

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.