How to get most views/most replies in this week/month,...

Discussion in 'PHP' started by goldensea80, May 9, 2008.

  1. #1
    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!
     
    goldensea80, May 9, 2008 IP
  2. Morishani

    Morishani Peon

    Messages:
    239
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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.
     
    Morishani, May 10, 2008 IP
  3. goldensea80

    goldensea80 Well-Known Member

    Messages:
    422
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    128
    #3
    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.
     
    goldensea80, May 10, 2008 IP
  4. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #4
    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.
     
    MMJ, Sep 20, 2008 IP