I have a table which holds the userID, highscore, and a timestamp.
I would like to sort by timestamp, so that the newest entries are at the top, and also, don't show any userID twice in the list, ergo, they need to be grouped.
I also need it to be sorted by score.
$sql="SELECT * FROM $table GROUP BY userID ORDER BY time DESC";
$sql2="SELECT * FROM $table GROUP BY userID ORDER BY score DESC";
At this moment, I see that Group by is done first, so I probably just get some random timestamps/stamps. I need to order them first, them Group them. However, I get errors if I switch Group by and Order by.
Could anybody help me out here? Thanks.