php - Count top 10 inputs in a table -


There is a function on my site where people can vote on photos. Every time someone clicks a vote button, my script adds a line to the table (mysql)

Each row looks like this: (table name = choice)

ID - -------- UserID --------- PhotoName --- ------ Date

1 ----------- 21 - ------------- 34234 -------- --- 20100101

How can I find the top 10 photographs on which people are voting? I tried " SELECT TOP 10 photoName FROM preference " but it did not work ...

  SELECT COUNT (*) as the dot, photoName FROM the name of the photo ORDER digit DESC LIMIT 10 by the preferred group;  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -