Help with creating/customizing a sports script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kyleo
Forum Newbie
Posts: 1
Joined: Thu Feb 03, 2011 6:45 pm

Help with creating/customizing a sports script

Post by kyleo »

Okay, I found a php script to help track standings (this is not a scrapper, I'm tracking standings for high school sports in my area).

This script is pretty much perfect, besides the fact that it does not count wins and losses against conference teams.

The developer is not currently supporting/developing this script, but he is trying to point me in the direction I need to complete this.

HOwever, after over a month of trying, I'm convinced I need help.

So, here is the code I currently have, below it is what he wrote which explains what it needs to do.

I can get this code to return numbers, just not the right ones. Reply back for any ounce of information you need...I'll supply whatever you want...I'm borderline desperate! LOL

Code: Select all

        (SELECT COUNT(*) FROM sportsdb_wins WHERE winner = teamid AND (winortie = 1 or winortie = 2) AND (SELECT teamid FROM sportsdb_teams WHERE teamid = loser AND teamdiv = teamdiv)) AS divwins,
        (SELECT COUNT(*) FROM sportsdb_wins WHERE loser = teamid AND (winortie = 4 or winortie = 5) AND (SELECT teamid FROM sportsdb_teams WHERE teamid = winner AND teamdiv = teamdiv)) AS divlosses,
"...A quick note, though: winortie value of 3 = play; 1 = beat; 2 = beat by forfeit; 0 = tied; 4 = lost; 5 = lost by forfeit. So it looks like the on-the-fly query is quite complicated: you have to check for winortie of 1 or 2 when the team ID is in the winner (aka Home) field, as well as winortie of 4 or 5 when the team ID is in the loser (aka Away) field, and then match up the other team in that game to the original team's division, just to get divwins."

I'll also need to get the number of losses, which would just be reversing the script.
Post Reply