I have this code below which grabs the standings for a team when i goto a team page..
whats wrong is that its grabbing standings information from other divisions where i just want to grab the standings for the division that the team is in
there is more code but i think the problem is within whats below
function Get_Stats($tid, $h_color){
$sql_standings = " SELECT c.*, t1.name t1_name, t1.h_color t1_color, t1.a_color t1_a_color, t2.name t2_name, t2.h_color t2_color, t2.a_color t2_a_color".
" FROM divisions b, schedule_scores c, (select division divid from teams where id = $tid) d, teams t1, teams t2".
" WHERE b.id = d.divid".
" AND c.season = b.seasonid".
" AND (c.team1_div = d.divid OR c.team2_div = d.divid) AND t1.id = c.team1 AND t2.id = c.team2 ORDER BY c.date";