Well, how's this look. I won't be able to test it until next Saturday.
Well, that's not entirely true. I'll be able to test it tonight when I
get home and am able to modify the time on my development
server.
Thanks for the tip drawmack, I never would have thought of
doing it that way...
$sql = $sql.'select g.gamenum,';
$sql = $sql.' g.gamedate,';
$sql = $sql.' g.homeid,';
$sql = $sql.' h.teamname home,';
$sql = $sql.' g.homescore hscore,';
$sql = $sql.' g.visitorid,';
$sql = $sql.' v.teamname visitor,';
$sql = $sql.' g.visitorscore vscore';
$sql = $sql.' from games g,';
$sql = $sql.' teams v, teams h';
$sql = $sql.' where (g.homeid = h.id and g.visitorid = v.id) ';
$sql = $sql.' and (WEEK(g.gamedate) = '.gmstrftime ("%W", time()-18000);
$sql = $sql.' and ( g.homescore is not null and g.visitorscore is not null )';
$sql = $sql.' and (h.division = "L" or v.division = "L")';