I have a script that creates an array with standings from a sports league, and if there are no standings I have it list out each team. My problem is that if one game has been played and I now have standings in my array, it will only list the teams that have played a game and all the other teams disappear. I'm trying to figure out how I can compare the entire team list to the teams in the standings and then print the remaining teams that have no stats, so their team page and schedule is still available.
Any help would be greatly appreciated.
Jonzy
while (list ($key, $value) = each ($standings_array)) {
$standings .= "
<tr bgcolor=\"#FFFFFF\" align=\"left\" valign=\"middle\">
<td class=\"table_text\">
<b><a href=\"./?opt=viewteam&id=".$value["id"]."&sid=".$season."\">".$key."</a></b></td>
<td class=\"table_text\" align=center>".$value["w"]."</td>
<td class=\"table_text\" align=center>".$value["l"]."</td>
<td class=\"table_text\" align=center>".$value["d"]."</td>
<td class=\"table_text\" bgcolor=\"#ffffcc\" align=center>".$value["pts"]."</td>
<td class=\"table_text\" align=center>".$value["gp"]."</td>
</tr>";
}
if($standings == "") {
$team_list = mysql_query("SELECT id,name FROM teams WHERE division = '$divid' ORDER BY name");
$total_team_list = mysql_numrows($team_list);
if($total_team_list != 0) {
$i = 0;
while ($i < $total_team_list) {
$tid = mysql_result($team_list,$i,"id");
$tname = mysql_result($team_list,$i,"name");
$standings .= "
<tr bgcolor=\"#FFFFFF\" align=\"left\" valign=\"middle\">
<td class=\"table_text\">
<b><a href=\"./?opt=viewteam&id=".$tid."&sid=".$season."\">".$tname."</a></b></td>
<td class=\"table_text\" align=center>-</td>
<td class=\"table_text\" align=center>-</td>
<td class=\"table_text\" align=center>-</td>
<td class=\"table_text\" bgcolor=\"#ffffcc\" align=center>-</td>
<td class=\"table_text\" align=center>-</td>
</tr>";
$i++;
}
}