Most Active User On Site?

Discussion in 'PHP' started by fireflyproject, Jul 31, 2008.

  1. #1
    Hey all,

    I'm building a custom stats system for a client of mine, and I'd like to add a 'most active user' area to the stats, but I'm not totally sure how.

    I have a mysql table with these columns.

    ID | IP | USER | TIME | REFERRER

    So I would like to parse the database and look for rows that have the same user, then count them. If I knew what user to look for in the first place, this would be a non-issue.

    Any tips on how to do this would be great. Thanks!
     
    fireflyproject, Jul 31, 2008 IP
  2. rob_v

    rob_v Peon

    Messages:
    72
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    select count(user),user from the_table_name
    group by user
    order by count(user) desc
     
    rob_v, Jul 31, 2008 IP
  3. fireflyproject

    fireflyproject Active Member

    Messages:
    969
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    70
    #3
    Cleeever. Thanks!! I'll put this to good use in a bit.
     
    fireflyproject, Jul 31, 2008 IP
  4. sriducati

    sriducati Peon

    Messages:
    287
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    but how to edit mysql?
     
    sriducati, Jul 31, 2008 IP