I’m building social network from scratch on PHP5 (Kohana3) + MySQL and need to find the best solution to print user messages along with the comments, message refeneces, news and some other similiar stuff in one facebook-like line.
Comments and message_references belong to messages.
What would be better, to receive the data from every table in seperate arrays on data using simple select statements and then array_push them in one and use multiple foreach’es to build output or use some complex sql to get it?
There is an opinion:
“Add new message – and you must refresh whole cached data instead of just adding cache for a new message – biakaveron Jun 11 at 19:17”
Create a feed table and a feed repository class which all other parts of the system use to create feed items.
Update
Your comment module would to like this:
Where
$userIdis the id of the user that got a comment.'comment'is the module that made the entry.