Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
Don't know nothing about your table layout or structure; so I don't know if this was even feasible. Create a table that contains two columns, e.g. 'user_id' and 'follower_id'. Both IDs saved in this table should strictly reference to user ID in users table, meaning you should not allow insertion or modification by arbitrary value here. Suppose you have a user with ID 1; when someone follows user with ID 1 - you create new record with value 1 for 'user_id' column and the follower's user ID for 'follower_id'. Example (in table) user_id folllower_id 1 2 1 3 ... Here means user with ID 1 is followed by 2 users, those are users with ID 2 and 3. * This table can also be used to record users that are being followed.
4th Apr 2020, 4:17 PM
Ipang
- 1
pubg
24th Apr 2020, 3:25 PM
Soe Thu
Soe Thu - avatar