Undefined index: teamtosort | Peter's Sports League Standings | Forum
Back to the sports standings script page
6:44 pm
Thank you for sharing your great script.
I am getting Undefined index: teamtosort errors in standings.php from the
"Past Games" and "Upcoming Games" sections in the corresponding lines
Do you have any amendments to the code which would solve the problem and reduce the php errors?
2:51 pm
There are a few others like this too.
From memory I think the string starts with $score_xxxxxxx.
I think it was in the team history section.
This is just another isset check as current php will serve a notice for unset variables.
Good luck.
If I can remember what file it was I will update here.
Rob.
Regarding the first, you can define score_sort and score_game_filter at the top of the function:
$score_sort = '';
$score_game_filter = '';
For the second, it is a bit more involved:
1. define $i = 0; before the "while" statement (line 14)
2. increment the variable before the closing "while" bracket (line 28): ++$i;