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

  • Home
  • SEARCH
  • 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 8925349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:40:27+00:00 2026-06-15T07:40:27+00:00

can someone show me data model for user register system which user can favorite

  • 0

can someone show me data model for user register system which user can favorite or blacklist(ban) each other?i am looking for best way but no one answered my questions well until now.by best way i mean we have less join for programing.

my user table until now

uid(pk) | name | family | blah blah blah ..

i just dont know how to desgin this favorite and blacklist which we just have one join or less?

i think it must be a one to many relation but how should i design this?

  • 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-06-15T07:40:28+00:00Added an answer on June 15, 2026 at 7:40 am

    you could have a second table listing the blacklists and/or favourites

    table
    id(pk) | userid_src(fk) | userid_dst(fk) | type

    If user A blacklists user B and then user A favourites user C and user B and C favourites each other you will have this where A is id 1, B id 2 and C id 3

    id(pk) | userid_src(fk) | userid_dst(fk) | type
    1      | 1              | 2              | blacklist
    2      | 1              | 3              | favourite
    3      | 2              | 3              | favourite
    4      | 3              | 2              | favourite
    

    EDIT: to retrieve the info of each user :

    SELECT * from users
    LEFT JOIN users_connections as con ON users.uid = con.userid_src
    LEFT JOIN users as userCon ON userCon.uid = con.userid_dst
    WHERE users.id = XXX
    

    XXX will be the id of your current user. You will then retrieve each connections between your current user and each user he blacklisted or added as favourite.

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

Sidebar

Related Questions

Can someone show me how to use the System.Numerics.BigInteger datatype? I tried using this
Can someone please tell me how to show all privileges/rules from a specific user
Can someone show me a system-enumerable that I can access quickly as an ItemsSource
Can someone show me how to print the ListView contents with the ColumnHeaders, without
can someone please show me documentation on this method? i have the following line:
Can someone tell/show me how to use PHP inside PHP. I'm trying to make
Given the example below, can someone please show me how this could be called?
Can someone please explain how Read/Show works.. I cannot find any tutorials on it.
Can someone follow what doing, and show me how to do it correctly? I'm
Can someone please tell me why this doesn't work? I'm trying to show and

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.