From cbbb0ebca043684eb6f8a958eb0850a7a5d92441 Mon Sep 17 00:00:00 2001 From: justin Date: Sat, 10 Apr 2010 17:03:29 +0000 Subject: [PATCH] When setting a score to zero, really make it null. --- admin/judging_score_edit.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/admin/judging_score_edit.php b/admin/judging_score_edit.php index 666cdd8..3013f89 100644 --- a/admin/judging_score_edit.php +++ b/admin/judging_score_edit.php @@ -41,8 +41,14 @@ $curr_team = $_POST['score_count']; while($curr_team > 0) { if($_POST["team_" . $curr_team . "_score"] != "") { + $score = $_POST["team_" . $curr_team . "_score"]; + if($score == 0) { + $score = "NULL"; + } else { + $score = mysql_real_escape_string($score); + } mysql_query("UPDATE judges_teams_timeslots_projects_link - SET score=" . mysql_real_escape_string($_POST["team_" . $curr_team . "_score"]) . + SET score=" . $score . " WHERE judges_teams_id = " . mysql_real_escape_string($_POST["team_" . $curr_team . "_id"]) . " and projects_id =$project_id and year=$year"); echo mysql_error();