There are users that can be referenced by an id as seen in the table below:
users:
user_id
I have attempted at a solution for keeping track of show views
tvshow_hits:
user_id|show_id
There is also a table with details in it:
tvshows:
show_id|name
But that is not required I'm open to change. I feel it isn't necessary to keep track of individual views more if they have watched it, since unlike music tv shows and movies are only watched once, and if they are watched again they don't carry any "weight".
So now I'll work backwards: The resulting page should look like this:
People Who Watch Also Watch
South Park 40%
Family Guy 20%
Something 10%
So, what I need is a query and (if needed) PHP code to
Select the shows (in order of P DESC), the amount of people who watch it compared to the other shows (that have been watched by users who have watched ) in percentage form AS P WHERE the show(s) have been watched by users who have watched LIMIT x
I hope that makes sense that is my best way of explaining it, feel free to think of another way to do what I'm trying to do. All suggestions and help welcome.