derekshull Posted February 25, 2013 Share Posted February 25, 2013 There is 2 parts to this post. The first part is this: I'm making a social network with followers on it. I want to people to be able to follow each other, so I have a database and a table of users. I've thought about how it would be possible for someone to follow a lot of people (say millions if they wanted to). My first thought was to create a table and just make 1 column for the username of the person and then add a bunch of columns of the usernames that person is following...but that's inefficient. So I needs ideas and advice on the code. Is there a possible way that when a person follows someone the system checks to see if that person has followed anyone else and if not they it puts their username in the first column and then puts the followee's username in the next column. Then when they follow someone else it look up the followers username name and just adds the next followee's username into the columns after the last followee? That way I don't have to have a set number of people that users can follow. Then there is the "news feed" part. I want to create a "news feed" that displays the posts of all the people the user follows. I have a table of posts that are flagged by the authors username and I WILL have the table of people the user follows. Any ideas on how to make the feed display in order what the peoples posts are that the user follows? Quote Link to comment https://forums.phpfreaks.com/topic/274927-advice-on-social-network-idea/ Share on other sites More sharing options...
Jessica Posted February 25, 2013 Share Posted February 25, 2013 Google "Data Normalization". As for your second part, it seems pretty obvious to use the date the post was created. I'm moving this to application design. Quote Link to comment https://forums.phpfreaks.com/topic/274927-advice-on-social-network-idea/#findComment-1414857 Share on other sites More sharing options...
derekshull Posted February 25, 2013 Author Share Posted February 25, 2013 Thanks. How would go about coding the second part though. How would I tell it to look at all the post of the people the user follows then display them? Quote Link to comment https://forums.phpfreaks.com/topic/274927-advice-on-social-network-idea/#findComment-1414874 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.