Thanks for reading.
I’m trying to write a query to list the names of people who have recevied the most votes using two tables:
-------
votes
-------
vote_id, giver_user_id, receiver_user_id, datetime
etc..
-------
users
-------
user_id, name, surname
etc…
So far I have:
$top_query = "SELECT * FROM vote, user WHERE vote.receiver_user_id = user.user_id GROUP BY receiver_user_id ";
This kind of works, but it doesn’t list the user with the most votes at the top of the list.
How can I order it this way?
Thank you.
OP
1 Answer