I am trying to create a League Standings page for the football team on the web site I am working on.
I enter the results into a database, and have been able to use subtraction of the scores (on the standings.php page) to determine a Win or a Loss.
Each School is given a value for the school:
$School[1] = St. Marys thru $School[10] = Shawnee
I then run this to determine their winning percentage:
<?php
$maxteams = 10
$count = 1;
do {
if ($Won[$count] + $Lost[$count] != 0) {
$Pct[$count] = number_format($Won[$count]/($Won[$count] + $Lost[$count]),3); }
else {
$Pct[$count] = number_format(0,3); }
$count++;
} while ($count <= $maxteams); ?>
This correctly returns what I want for each team.
Now, I want to display this information in a table, sorting the array with the highest $Pct first, and $School ASC as the secondary sort in this format:
// I am omitting the table tags to clarify things.
$School $Won $Lost $Pct // and have this repeated for the rest of the sorted array
Anybody have any suggestions?