Assuming that your using MySQL, and that I understand you...
Code:
$teamascore = 2;
$teambscore = 4;
if($teamascore > $teambscore) {
mysql_query("UPDATE league SET points=points+3 WHERE team='$teamaid'");
} elseif($teambscore > $teamascore) {
mysql_query("UPDATE league SET points=points+3 WHERE team='$teambid'");
} else { //Draw
mysql_query("UPDATE league SET points=points+1 WHERE teamid='$teamaid' OR teamid='$teambid'");
}
Something along those lines.
(Yes its bad code, but who cares)