]> git.sesse.net Git - wloh/blobdiff - common.pm
Move get_max_season() into the common package.
[wloh] / common.pm
index 37c59a377e74f4e6cfbff38fb0e14bdb68d1c7cc..7ec01a06e4eee50bb8975329ff0e47f9779bc2b2 100644 (file)
--- a/common.pm
+++ b/common.pm
@@ -4,6 +4,12 @@ use POSIX;
 
 package wloh_common;
 
+sub get_max_season {
+       my $dbh = shift;
+       my $ref = $dbh->selectrow_hashref('SELECT MAX(sesong) AS max_sesong FROM fotballserier');
+       return $ref->{'max_sesong'};
+}
+
 sub output_last_sync {
        my $dbh = shift;
        my $ref = $dbh->selectrow_hashref('SELECT EXTRACT(EPOCH FROM last_sync) AS last_sync FROM last_sync');