I have the following php statment to query a DB:
[CODE]
$New = “SELECT *, Max(Hi_Score) FROM players LEFT JOIN playerstats ON players.id_Player = playerstats.id_Player WHERE players.Team1 = ‘$Team’ OR players.Team2 = ‘$Team’ OR players.Team3 = ‘$Team’ GROUP BY LName ORDER BY Hi_Score DESC”;
$result = mysql_query($New);
while($row = mysql_fetch_array($result)){
echo $row[‘LName’]. ” – “. $row[‘Max(Hi_Score)’];
echo “<br />”;
}
I use the GROUP BY function to find the highest score for each player. I also want these players and their scores to be orders from the highest score to the lowest.
eg.
John = 14
Peter = 50
James = 25
Robert = 15
should look like:
Peter = 50
James = 25
Robert = 15
John = 14
The query does give me the high scores for each player but not in order.
How can I get the query to order it?
Please help me.