Jump to content

[SOLVED] Php - Mysql Help. Calculate most active user based on num. of matching rows?


Recommended Posts

Okay, so what I'm trying to do is to calculate the number activities (rows) users have made in a table I call, lets say, ACTIVITIES in the last 24hrs.

 

I then want to select the ID of the user that has had the most activity in the last 24hrs, however without selecting all of his activities and each of those rows information, because the table activities is mainly for the purpose of determining the most active user (by the amount of rows selected with his matching userid/ sort of a mode type thing) and select their userid based on that.

 

Can anybody tell me a way or what I can use to accomplish this? Or it its even possible? :confused:

 

I don't need help with any timing or anything like that, just a way.

 

Hope this makes sense, kinda rushed through it, a little frustrated.

 

Thanks ahead.....  :)

 

Thanks...

 

 

But the problem with using that is that it will simply just count the rows of a specific user. I need to count the rows of all users and then select the id of the one with the highest count.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.