什么是“其他表、列相关、动态表状态”?
我正在尝试在一些设计文件上绘制数据库模板,但我在依赖关系方面遇到了麻烦。
用户向网站提交内容供查看,网站根据内容的类型给予内容优先级。不过,我也希望优先级由用户设置。基本上,如果人 A 是人 B 的朋友,则人 A 提交的内容对于人 B 来说具有高优先级。人 C 不是人 A 的朋友,因此在该媒体中,人 C 提交的内容对于人 C 来说具有低优先级。
我什至不知道从哪里开始。任何朝正确方向的推动都将受到赞赏。我认为这是一个MySQL问题;然而,我使用 PHP 作为服务器端脚本语言,并且我想知道数学是否使得没有通过 MySQL 的解决方案。
目前,我正在考虑仅使用一个区域来存储好友内容,而不是搞乱优先级。
I'm trying to sketch out a database template on some design paper, and I'm having trouble with dependencies.
Users submit content to the website for viewing, and the content is given priorities based on what kind of content it is. I also would like the priorities, however, to be set by user. Basically, if person A is person B's friend, the content submitted by person A is high priority for person B. Person C is not person A's friend, so the content is low priority for person C in this medium.
I don't even know where to begin. Any push in the right direction would be appreciated. I think that this is a MySQL question; however, I am using PHP as the server-side scripting language, and I'm wondering if the math makes it so that there isn't a solution via MySQL.
I'm thinking about just using a region for friend content and not messing with priorities, currently.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要您跟踪您需要的内容,就不会有问题,技巧就在于编写 Sql.例如,如果您有以下表结构,
您可以编写以下语句,该语句将检索与某个人关联的所有内容,不包括他们自己的内容,按 content_priority 确定优先级
如果您愿意,您还可以使用加权优先级,因此 ORDER BY 可以是
您应该注意的是,此 SQL 和表设计独立于 RDBMS 和 Web 技术。
As long as you track what you need it shouldn't be problem, the trick will be in writing the Sql. For instance if you had the following table structure
You could write the following statement which would retrieve all the content associated with a person, excluding their own content, prioritized by content_priority
If you want you could also use weighted priority so the ORDER BY could be
You should note that this SQL and table design is independent of the RDBMS and the web technology.