Jump to content

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


itsureboy

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.