justlukeyou Posted June 18, 2012 Share Posted June 18, 2012 I saw this site and Im curious how the social network follow system would work. Its very similiar to Facebook. Does each user a have a table with columns 'Follow1', 'Follow2' etc. So when another user clicks the follow button their unique user ID drops into the first 'Follow' column available. For example if ID 123456 is the first user to follow ID 654321. The ID number 123456 is entered into 'Follow1' and so on. Then you can echo information using the ID number? www.houzz.com/ Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted June 18, 2012 Share Posted June 18, 2012 You'd have one table and it'd look similar to this: | relation_id | follower_id | followed_id | token | token | token | You can then get the IDs of whom a person is following and is followed by with one query. Quote Link to comment Share on other sites More sharing options...
justlukeyou Posted June 18, 2012 Author Share Posted June 18, 2012 Thanks, so is 'Token' the unique ID number? I thought each column name had to have a unique name. What does 'relation_id' mean? Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted June 18, 2012 Share Posted June 18, 2012 Thanks, so is 'Token' the unique ID number? I thought each column name had to have a unique name. No, the 'token's can be whatever you want, they don't mean anything. the relation_id is the auto increment and unique column. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.