I am looking for a solution using MySQL and/or PHP.
So I have a MySQL database with a video table looking like this...
Record Keywords
1 Action, Sci-Fi, Future
2 Comedy, Jokes, Sci-Fi
3 Youtube, Sci-Fi, Jokes
My problem is that I need to figure out a way to get the different keywords, count the number of occurrences they have and how many views... So I am trying to get something like this:
Tag Occurences
Sci-Fi 3
Jokes 2
Action 1
Future 1
Comedy 1
Youtube 1
Now, I have over 20,000 rows in this table with multiple keywords for each of these rows and I need to be able to place a top N on each of our page, also, this list needs to be dynamic and in real-time, so performance is an extremely important aspect.