Specify join, so that we don't join tournament+score on country. :-)
[ccbs] / html / tournaments.pl
index 1f00a95..3fc3531 100755 (executable)
@@ -5,7 +5,8 @@ use strict;
 use warnings;
 
 my $dbh = ccbs::db_connect();
-my $tournaments = ccbs::db_fetch_all($dbh, 'SELECT * FROM tournaments');
+my $tournaments = ccbs::db_fetch_all($dbh, 'SELECT * FROM tournaments NATURAL JOIN seasons ORDER BY season, date');
 
 ccbs::print_header();
-ccbs::process_template('tournaments.tmpl', 'Turneringer', { tournaments => $tournaments });
+ccbs::process_template('tournaments.tmpl', 'Tournaments', { tournaments => $tournaments });
+$dbh->disconnect;