Maverickb7 Posted April 13, 2006 Share Posted April 13, 2006 I was wondering if someone could help me with something. I have a table in my database and within one of the columns is the user id of whom ever created the row. Now what I would like to do is display the top x posters. So I need to somehow count how many times each user id is listed then display the top x users. Does anyone know how I would go about doing this? Link to comment https://forums.phpfreaks.com/topic/7266-counting-something/ Share on other sites More sharing options...
.josh Posted April 13, 2006 Share Posted April 13, 2006 SELECT username, count( * ) AS blah FROM tablename GROUP BY username ORDER BY blah DESC LIMIT 10 you might have to play with that a bit but that should get you going. Link to comment https://forums.phpfreaks.com/topic/7266-counting-something/#findComment-26471 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.