I'm having an issue with the Next Games line in the pro and farm team headers.
http://www.nsimhl.com/ProTeam.php?Team=3
Below is code from ProTeam.php. I changed the "ORDER BY GameNumber LIMIT 1" to "ORDER BY Play LIMIT 1" for the next game.
$Query = "SELECT * FROM SchedulePro WHERE (VisitorTeam = " . $Team . " OR HomeTeam = " . $Team . ") ORDER BY Play LIMIT 1";
$ScheduleNext = $db->querySingle($Query,true);
In my tests everything works out just fine. When I uploaded today, it appears to only be showing the team's next road game.
I need help!
Next Games
-
- STHS Owner / Propriétaire du STHS
- Posts: 14798
- Joined: Sat Oct 08, 2005 4:18 pm
- Location: Montreal, Canada
- Contact:
Re: Next Games
Why do you want to order by Play? It doesn't make sense to me. The Play is True or False and not a good variable to order by.
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English Manual - Manuel Français
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English Manual - Manuel Français
Re: Next Games
You are correct regarding the order by play. I shouldn't have done that, but the answer wasn't coming to me yesterday so I tried it and it was working in my test file.
I had to change the code to correctly show the team's next game because as written it will display each team's first game as their next game.
This morning I added the following to the code: AND Play = 'False' so the query string looks like this:
$Query = "SELECT * FROM SchedulePro WHERE (VisitorTeam = " . $Team . " OR HomeTeam = " . $Team . ") AND Play = 'False' ORDER BY GameNumber";
$ScheduleNext = $db->querySingle($Query,true);
This appears to have fixed the issue, as the team's next game is displayed correctly.
I had to change the code to correctly show the team's next game because as written it will display each team's first game as their next game.
This morning I added the following to the code: AND Play = 'False' so the query string looks like this:
$Query = "SELECT * FROM SchedulePro WHERE (VisitorTeam = " . $Team . " OR HomeTeam = " . $Team . ") AND Play = 'False' ORDER BY GameNumber";
$ScheduleNext = $db->querySingle($Query,true);
This appears to have fixed the issue, as the team's next game is displayed correctly.
-
- STHS Owner / Propriétaire du STHS
- Posts: 14798
- Joined: Sat Oct 08, 2005 4:18 pm
- Location: Montreal, Canada
- Contact:
Re: Next Games
In the STHS code, the query also has "LIMIT 1" at the end. Why didn't work for you?
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English Manual - Manuel Français
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English Manual - Manuel Français