Anyone here have experience of implementing the statistics like youtube: The movie that has most views/most replies in this week/month,...Can you share some ways of doing this in PHP&MySQL? Thanks in advance!
It is preety much a medium SQL query, but we can't help you if we don't have the column names and types of your statistics table in your MySQL database. (If you do have one). If you don't have one, That's preety much complicated to help you to create one and apply it to the website.
Thanks for replying. I indeed have the current database structure. And I know that it's hard/impossible to implement the idea. (I just have table stories which has story_views to count the statistics). I just want to know the idea/structures and the algorithm to do this. There's must be more than one way, right? It'd be too much to ask some one help me to create/apply to my website.
Each time a story is opened increase the view by one then you can do something like: select * from `story_views` ORDER BY `views` LIMIT 1 Code (markup): Very simple SQL logic.