2007 World Cup overall ranking

for ($task=1;$task {
$pts = db_result(db_query("SELECT MAX(T$task) from 2007_SCORE_PWC"));
if ($pts==0) { $task--; break; }
}
print "Ranking updated after task $task

";

$mytable = array();

// Title
$myheader = array("Rank","Name","Nation","Glider","Points");

$myquery = db_query("SELECT PWC_RANK, SURNAME, FIRST_NAME, NAT, GLIDER, OVERALL, PILOT_ID from 2007_SCORE_PWC where OVERALL>0 order by PWC_RANK");

while ($myresult = db_fetch_array($myquery))
$mytable[] = array($myresult["PWC_RANK"], "".$myresult["SURNAME"]." ".$myresult["FIRST_NAME"]."", $myresult["NAT"], $myresult["GLIDER"], $myresult["OVERALL"]);

echo theme_table($myheader, $mytable);

?>