开发者

Making a 'facebook' style feed using PHP

I'm trying to make a facebook style news feed on my webpage that combines user input from multiple tables into a feed.

Would the best way to approach this be:

(1) Using mySQL Join Queries (2) Using mySQL single queries from multiple tables into an Array. (3) Another way?

Thanks.

Edit:

The structur开发者_运维问答e of my Databases are as follows:

1 User (Table: User)
Mutliple Blogs per user (Table: Blog)
Mutliple Content Upload per user (Table: Content)

What I am trying to achieve is a query that will collect the defined users ID's blog post and content uploads and display them in chronological order.

Thanks for the replies!


This is difficult to answer without knowing anything about your database schema (consider editing your question to add some details), but you may wish to consider creating a View that you could then retrieve and present your news feed from with a single, simple query.


If there is going to be a lot of data it is good to have a separate table that holds your "feed". That way, you don't have a lot of overhead each time you do your query.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜