PHP: How to create a 'feed' for users (DB Design)?
===

So on my website users can perform different tasks such as commenting, joining groups, sending messages, giving feedback, etc. Now I want to create a feed on the users profile page which tells everyone what they have been doing, kind of like facebook but much simpler.

Example:

`John Doe sent a message to Bob Smith`

`Bob Smith gave some feedback to John Doe`

`Bob Smith joined John Doe's group`

To do something like this, should I pull all of the information from the appropriate tables  or do I insert a row into a 'feed' table every time a task is performed which I want to be included in the feed.

Basically I want to achieve like what they do on stackoverflow with the activity tab on the profile page. Note: I'm using PHP and mysqli, Thanks.