简体   繁体   English

使用PHP和MySQL向用户显示“新内容”消息的一般思路是什么?

[英]What's the general idea on displaying 'what's new' message to user using PHP and MySQL?

Just like Twitter's pattern, one user can follow another, and the others' news containing new tweets, new photos and something like that will display on this user's homepage in time order. 就像Twitter的模式一样,一个用户可以跟随另一个用户,而其他人的新闻包含新的推文,新的照片以及类似的内容将按时间顺序显示在该用户的主页上。
I don't have any idea on this. 我对此一无所知。 One may follow thousands of other users, if i use 'select' to do this, there would be too much select query to do. 一个人可能会跟随成千上万的其他用户,如果我使用“选择”来执行此操作,将会有太多的选择查询要做。
If anyone please tell me a general idea on this? 如果有人请告诉我有关此的一般想法?

Then you use TOP or LIMIT in your query to limit the amount of returned results. 然后,您在查询中使用TOPLIMIT来限制返回结果的数量。 You could implement paging with, say, 50 messages per page, so each query will only return 50 messages. 您可以实现每页50条消息的分页,因此每个查询将仅返回50条消息。

u can keep track of ur records with an additional columns to status and datetime. 您可以通过状态和日期时间的其他列来跟踪您的记录。 That way you can post the latest status and datetime. 这样,您可以发布最新状态和日期时间。 Note you must write code to change the status according to entries, meaning u must change the status of a previous record whenever a user addes new record. 请注意,您必须编写代码以根据条目更改状态,这意味着u每当用户添加新记录时都必须更改先前记录的状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM