I have groups on my website, and would like users to follow groups, and groups to follow users. I was wondering how does the following/follower works, in terms setting out in a MySQL table and referencing users? I’m very confused!!
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
The simplest way I can think of to do this is with two tables. One table is just a list of users, each with a unique
userIdand any other information you need to store about the user. The second table would keep track of who is following who by simply associating users by theiruserId. It could be just two columns,leaderIdandfollowerId, where both columns are foreign keys to theuserIdin the main table.You can then get a list of a user’s followers by selecting all the rows where they are the leader.