Page 1 of 1

mysql_num_rows question

Posted: Mon Jan 22, 2007 12:16 am
by jammr
I'm trying to write a script to check a table to see which number is the "most popular" per se. I basically want to show the top 10 most popular X based on the number of that number in the row, if that's understandable. I'm having trouble visualizing how I would write this...

Thanks for reading this,
thanks in advance for any help on this..

Posted: Mon Jan 22, 2007 1:53 am
by aaronhall
Something like

Code: Select all

SELECT row, COUNT(row) as occurrences FROM table GROUP BY row

Posted: Mon Jan 22, 2007 2:04 am
by jammr
Thanks for the help :D I appreciate it.