Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3320124
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:54:21+00:00 2026-05-17T22:54:21+00:00

Now i am working on a social network website and i already built the

  • 0

Now i am working on a social network website and i already built the friends table for this website but i need some suggestion before i moved forward.

I have a user table where user_id is the primary field.

So for friends i made a friends table with fields like

friend1,friend2,is_active

what i do actually when user1 send a friend request to user2 then at that moment i insert the two rows into the friends table like

1- friend1->user1,friend2->user2,inactive
2- friend1->user2,friend2->user1,inactive

So when somebody accept the friend request at that moment i made the both rows as active.

I made this two entries as i want whenever one user block another then easily made that corresponding row belongs to that user will be inactive.

And if a user remove the user then at that time i delete the both entries.

So please i need some suggestion regarding this please help me out to solve this asap.

I need to know is there any other way which will be more optimized than this and giving proper result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:54:22+00:00Added an answer on May 17, 2026 at 10:54 pm

    I think that
    Friends_table
    with

    User_id1, User_id2 and Rleationship_id

    is easier, index on both first and second column.
    relationship id will be 1 – id1 request, 2- id2 request, 3 – friends, 4- id1 blocked, 5 – id2 blocked…

    just an idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There's this project I am working on. This is like a social network where
Now I'm working on social network (ASP.NET MVC 3). And I want to add
this may come as pretty odd but I'm now working on a membership based
This suddenly stopped working, it was working, but now its not: If I use
Im working right now on a program that can divide, add, ect, but, im
Right now I am working on one Real Estate Website, In that website I
I am now working on a some sort of a game engine and I
I'm now working on vbscript to do some test. Actuelly, I want to retrieve
Thanks to Code Poet, I am now working off of this code to parse
I just read this blog post and it stated that: Google is now working

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.