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?
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
EDIT: to retrieve the info of each user :
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.