OK, here is my question, I have been struggling with this for a while. I am making a website for my XC league, I am trying to create a way to automate the scoring system, so all coaches have to do is enter times and it will put out the score. The problem I have is that cross country is scored in a stange way:
The races have up to 4 teams, but the scoring is head to head matchups. (i.e. Team A, B, C and D race, but the scoring is A vs. B, A vs C, A vs D, B vs C and so forth)
The lowest score wins. First gets one points, second 2,... Only the first 5 runners on each team score, but the 6th and 7th displace (i.e. ).
The scoring must reset each matchup.
So i am extremely confused, every thing I have done isn't working. I need to find a way so that I can split the results of 4 teams into two team segments, then score them individually.
here is what i have:
// testing automated scoring
$query = "select * from results where home ='".addslashes($school)."' and race = '".$date."' and level = '".$level."' order by school, rank";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$score = 0;
// echo "<tr><td><font size=2>".$row["school"].":";
$sch1 = $row["school"];
for ( $row["rank"]=1; $row["rank"] <=7; )
{
if ( $sch1 = $row["school"] )
{
echo $row["rank"].", ";
$row["rank"] += 1;
}
else {
$row["rank"] += 1;
}
}
// Test 2 of auto scoring
// testing automated scoring
$query = "select from results where home ='".addslashes($school)."' and race = '".$date."' and level = '".$level."' order by school, rank";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$score = 0;
// echo "<tr><td><font size=2>".$row["school"].":";
$sch1 = $row["school"];
$query = "select from results where home ='".addslashes($school)."' and race = '".$date."' and level = '".$level."' and school = '".$school."' order by rank";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
for ( $row["rank"]=1; $row["rank"] <=7; )
{
echo $row["rank"].", ";
$row["rank"] += 1;
}
Any ideas? please help.
Thanks,
Conor
conor_hurley@nobles.edu