From: Steinar H. Gunderson Date: Mon, 14 Feb 2005 20:38:03 +0000 (+0000) Subject: Correct number of qualified people from round >= 1. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=f3e1d3c28ccb302af953bc27c303c5256cc4e60e Correct number of qualified people from round >= 1. --- diff --git a/html/show-tournament.pl b/html/show-tournament.pl index 30c1e51..55bd2b4 100755 --- a/html/show-tournament.pl +++ b/html/show-tournament.pl @@ -71,7 +71,7 @@ if ($num_rounds == 0) { my $ref = $dbh->selectrow_hashref('SELECT COUNT(*) AS num_participants FROM tournamentparticipation WHERE tournament=?', undef, $id); $num_qualified = $ref->{'num_participants'}; } else { - my $ref = $dbh->selectrow_hashref('SELECT numqualifying FROM rounds WHERE tournament=? AND round=?', undef, $id, $num_rounds); + my $ref = $dbh->selectrow_hashref('SELECT SUM(numqualifying) AS numqualifying FROM rounds NATURAL JOIN groups WHERE tournament=? AND round=?', undef, $id, $num_rounds); $num_qualified = $ref->{'numqualifying'}; }