When setting a score to zero, really make it null.

This commit is contained in:
justin 2010-04-10 17:03:29 +00:00
parent 384efa3363
commit cbbb0ebca0

View File

@ -41,8 +41,14 @@
$curr_team = $_POST['score_count']; $curr_team = $_POST['score_count'];
while($curr_team > 0) { while($curr_team > 0) {
if($_POST["team_" . $curr_team . "_score"] != "") { 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 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"]) . " WHERE judges_teams_id = " . mysql_real_escape_string($_POST["team_" . $curr_team . "_id"]) .
" and projects_id =$project_id and year=$year"); " and projects_id =$project_id and year=$year");
echo mysql_error(); echo mysql_error();