From ad64e0259097c91f67ea896134128c6883e42900 Mon Sep 17 00:00:00 2001
From: Arun Persaud
\n";
echo "
These players lost their fox least often per game:
\n";
+ $result = mysql_query("SELECT COUNT(*) /" .
+ " (SELECT COUNT(*) FROM Hand".
+ " WHERE user_id=User.id) as c,".
+ " fullname".
+ " FROM Score".
+ " LEFT JOIN User ON User.id=looser_id".
+ " WHERE score='fox'".
+ " GROUP BY looser_id".
+ " ORDER BY c ASC LIMIT 5" );
+ while( $r = mysql_fetch_array($result,MYSQL_NUM))
+ echo $r[1]." (".$r[0].")
\n";
+ echo "
Which positions at the table make the most tricks:
\n";
$result = mysql_query("SELECT COUNT(*) AS c,winner FROM Trick".
@@ -213,6 +227,31 @@ else if( isset($_SESSION["name"]) )
echo " bottom ".$r[0]."
\n";
echo "
Most games played on the server:
\n";
+ $result = mysql_query("SELECT COUNT(*) as c, " .
+ " fullname FROM Hand".
+ " LEFT JOIN User ON User.id=user_id".
+ " GROUP BY user_id".
+ " ORDER BY c DESC LIMIT 7" );
+ while( $r = mysql_fetch_array($result,MYSQL_NUM))
+ echo $r[1]." (".$r[0].")
\n";
+ echo "
These players are involved in this many active games:
\n";
+ $result = mysql_query("SELECT COUNT(*) as c, " .
+ " fullname FROM Hand".
+ " LEFT JOIN User ON User.id=user_id".
+ " LEFT JOIN Game ON Game.id=game_id".
+ " WHERE Game.status<>'gameover'".
+ " GROUP BY user_id".
+ " ORDER BY c DESC LIMIT 7" );
+ while( $r = mysql_fetch_array($result,MYSQL_NUM))
+ echo $r[1]." (".$r[0].")
\n";
+ echo "