X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=html%2Fsong.pl;h=c17f3dd8c1664783602517f12581d7fce942a9ea;hp=8445bc5f13041627f45dfbcdcf36c6d22335ab10;hb=9a91e199a828e7e317335bb4121761950f31ccef;hpb=f77426158d4ef1b9b4a344de2d6cf6ef0c398734 diff --git a/html/song.pl b/html/song.pl index 8445bc5..c17f3dd 100755 --- a/html/song.pl +++ b/html/song.pl @@ -10,7 +10,7 @@ my $id = $cgi->param('id'); my $dbh = ccbs::db_connect(); my $song = $dbh->selectrow_hashref('SELECT * FROM songs WHERE song=?', undef, $id); -my $scores = ccbs::db_fetch_all($dbh, 'SELECT * FROM scores NATURAL JOIN players NATURAL JOIN tournaments WHERE song=? AND score IS NOT NULL ORDER BY score DESC LIMIT 50', $id); +my $scores = ccbs::db_fetch_all($dbh, 'SELECT * FROM scores NATURAL JOIN players JOIN tournaments ON scores.tournament=tournaments.tournament WHERE song=? AND score IS NOT NULL ORDER BY score DESC LIMIT 50', $id); ccbs::print_header(); ccbs::process_template('song.tmpl', $song->{'title'}, {