From ed77839b314639904743a85ff4ea4c5079102464 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 16 Feb 2005 14:35:20 +0000 Subject: [PATCH] Make it possible to enter NULL values by leaving fields blank. --- html/do-edit-scores.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/html/do-edit-scores.pl b/html/do-edit-scores.pl index fe29c16..8b28303 100755 --- a/html/do-edit-scores.pl +++ b/html/do-edit-scores.pl @@ -20,9 +20,12 @@ for my $p ($cgi->param()) { next unless (defined($cgi->param('old-' . $p))); next if ($cgi->param($p) eq $cgi->param('old-' . $p)); + my $val = $cgi->param($p); + undef $val if ($val =~ /^\s*$/); + if ($p =~ /^score(\d+)-(\d+)/) { $dbh->do('UPDATE scores SET score=? WHERE tournament=? AND round=? AND parallel=? AND player=? AND songnumber=?', undef, - $cgi->param($p), $tournament, $round, $group, $1, $2); + $val, $tournament, $round, $group, $1, $2); } } -- 2.39.2