+/* longest and shortest game */
+$r=DB_query("SELECT timediff(mod_date,create_date) ,session,id".
+ " FROM Game WHERE status='gameover'".
+ " ORDER BY time_to_sec(timediff(mod_date,create_date)) ASC LIMIT 1");
+
+if($r)
+ {
+ $short= DB_fetch_array($r);
+ $names = DB_get_all_names_by_gameid($short[2]);
+ echo "<p> The shortest game took only ".$short[0]." hours and was played by ".join(", ",$names).".<br />\n";
+ }
+
+$r=DB_query("SELECT datediff(mod_date,create_date) ,session,id".
+ " FROM Game WHERE status='gameover'".
+ " ORDER BY time_to_sec(timediff(mod_date,create_date)) DESC LIMIT 1");
+if($r)
+ {
+ $long= DB_fetch_array($r);
+ echo "The longest game took ".$long[0]." days.</p>\n";
+ }
+
+$r=DB_query("SELECT COUNT(*) as c, session, id FROM Game ".
+ " GROUP BY session ORDER BY c DESC LIMIT 1");
+if($r)
+ {
+ $long = DB_fetch_array($r);
+ $names = DB_get_all_names_by_gameid($long[2]);
+ echo "The longest session is session ".$long[1]." with ".$long[0].
+ " games played by ".join(", ",$names).".</p>\n";
+ }
+