![]() |
How do to get User Activity of friends? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How do to get User Activity of friends? (/showthread.php?tid=25464) |
How do to get User Activity of friends? - El Forum - 12-12-2009 [eluser]flyenig[/eluser] If you go on myspace, or facebook, or twitter, they have an activity stream of all your friends - Their Status', pictures that has been recently uploaded, etc. How would their sql statement look like to retrive the statuses of every friend? How do to get User Activity of friends? - El Forum - 12-12-2009 [eluser]bretticus[/eluser] This really isn't that hard. You need a table to store actions that EVERYONE performs. You need a table that maps a friend to a user. You need a user table to store user details (in particular an auto-incremented user id for the aforementioned map table.) Finally just query the action records by joining the three tables and restrict to friends by using a where clause on the map table to friends of the current user only. |