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 8910271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:38:50+00:00 2026-06-15T03:38:50+00:00

i am going to design my blacklist and favorite in php list which user

  • 0

i am going to design my blacklist and favorite in php list which user can blacklist and favorite other persons and now i just want to know is it better to design like this

+-----+------+------------+
| uid(pk) | name | family |
+-----+------+------------+

and another table like this which is composite primary key

+-----+------+------------------------+
| uid(pk) | blacklisted_person_id(pk) |
+-----+------+------------------------+

or desgin with primary key and foreign key in it, which i dont know how to design in this case that user cant blacklist himself or blacklist some person 2 times.if someonce can describe it a little ill be grateful.
thanks in advance

  • 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-15T03:38:51+00:00Added an answer on June 15, 2026 at 3:38 am

    Your solution is good, but I’d recommend just calling your PK in your user table just id not uid and then in your mapping blacklist table refer to it as user_id (if user is the name of the user table) and blacklisted_user_id. That way there is no ambiguity to what table these individual columns are foreign keys to.

    The reason it’s a good solution is that it will prevent duplicates from being entered without having to create an additional unique composite key.

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

Sidebar

Related Questions

I have a class which is going to need to use the strategy design
I'm going to design an Application (C# or VB.NET) which use .NET Framework to
I was just going through Design Patterns Questions on Stackoverflow and everyone mentioned about
I am going to design an App for iPhone 4s where user will have
I'm going through Skiena's The Algorithm Design Manual which uses C. All the examples
I was just going through section 5.3 of Operating Systems: Design and Implementation :
Am going to design a game about raising dragons but don't know a way
This is more of a PHP design question. Basically, I'm going to have a
So I'm going with nHibernate, but want to design my datalayer so I could
I was just going through some tutorial on responsive web design or fluid layouts.

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.