Jump to content

order by count


UnknownPlayer

Recommended Posts

I need help, i have table votes, and i wonna count all votes by same id and  order them by most voted, can someone help me ?

 

examplem i have in votes table these datas:

id     name_id
1        23
2        25
3        25
4        24
5        23
6        23

id is primary key, auto inc, and now i need to order it like this:

23 with 3 votes

25 with 2 votes

24 with 1 votes

 

Can someone help me please?

Link to comment
https://forums.phpfreaks.com/topic/224769-order-by-count/
Share on other sites

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.