I have a query which lists players and sort them 1) on how many points they have scored, 2) on how many goals they have scored.
When I run it it selects 10, but with a very odd sorting, the #1 player has only 9 points, while I'm very certain that some players have over 50 points, so it's not working right. Any ideas? thanks
$scoring = "SELECT player.Firstname, player.Lastname, player.Pos, stats.PlayerID, stats.TeamID, stats.KID, team.Team, stats.StartDate, stats.EndDate, stats.League, stats.GP, stats.G, stats.A, stats.TP, stats.PIM FROM player INNER JOIN team ON team.TeamID = stats.TeamID INNER JOIN stats ON player.PlayerID = stats.PlayerID WHERE stats.EndDate='2002' AND player.Pos='F' AND stats.League ='SEL' ORDER BY stats.TP DESC, stats.G DESC LIMIT 10";
$result = mysql_query($scoring,$db_link);
$rows = mysql_num_rows($result);
for($index = 0; $index< $rows; $index++) {
$Firstname = mysql_result($result,$index,"Firstname");
$Lastname = mysql_result($result,$index,"Lastname");
$GP = mysql_result($result, $index, "GP");
$G = mysql_result($result, $index, "G");
$A = mysql_result($result, $index, "A");
$TP = mysql_result($result, $index, "TP");
echo "$Firstname $Lastname $GP $G $A $TP<br>";