It's part of a long code... it one team is high then the other it all works well it's when i add this option for a draw it goes crazy.... does anyone see any BASIC problems/errors??
<?php
// IF its a draw //
if ($row5["team1_score"] == $row5["team2_score"])
{
$team1_id = $row5["team1_id"];
$result6 = mysql_query ("SELECT * FROM results_comptable where team_id = $team1_id");
$row6 = mysql_fetch_array($result6);
$team_pld = $row6["team_pld"] + 1;
$team_d = $row6["team_d"] + 1;
$team_f = $row6["team_f"] + $row5["team1_score"];
$team_a = $row6["team_a"] + $row5["team2_score"];
$team_pts = $row6["team_pts"] + $row2["points_draw_value"];
$team_dif = $team_f - $team_a;
$result6 = mysql_query ("update results_comptable set team_pld = '$team_pld', team_w = '$team_w', team_f = '$team_f', team_a = '$team_a', team_pts = '$team_pts', team_diff = '$team_dif' where team_id = $team1_id") or die("INSERT error: ".mysql_error());
$team2_id = $row5["team2_id"];
$result6 = mysql_query ("SELECT * FROM results_comptable where team_id = $team2_id");
$row6 = mysql_fetch_array($result6);
$team_pld = $row6["team_pld"] + 1;
$team_d = $row6["team_d"] + 1;
$team_f = $row6["team_f"] + $row5["team2_score"];
$team_a = $row6["team_a"] + $row5["team1_score"];
$team_pts = $row6["team_pts"] + $row2["points_draw_value"];
$team_dif = $team_f - $team_a;
$result6 = mysql_query ("update results_comptable set team_pld = '$team_pld', team_w = '$team_w', team_f = '$team_f', team_a = '$team_a', team_pts = '$team_pts', team_diff = '$team_dif' where team_id = $team1_id") or die("INSERT error: ".mysql_error());
}
?>