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.
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.