$hour_max) $hour_max = $r_ghours['res_count']; $hour_sum += $r_ghours['res_count']; } if ($hour_max == 0) return; // Daily Breakdown // We use WEEKDAY rather then DAYOFWEEK because now the week starts with Monday instead of Sunday $sql_gdays = "SELECT WEEKDAY(time) AS res_day, COUNT(*) AS res_count FROM uts_match m, uts_player p WHERE $bgwhere AND m.id = p.matchid GROUP by res_day"; $q_gdays = mysql_query($sql_gdays) or die(mysql_error()); $day_max = 0; $day_sum = 0; while ($r_gdays = mysql_fetch_array($q_gdays)) { $gb_day[$r_gdays['res_day']] = $r_gdays['res_count']; if ($r_gdays['res_count'] > $day_max) $day_max = $r_gdays['res_count']; $day_sum += $r_gdays['res_count']; } // Monthly Breakdown $sql_gmonths = "SELECT MONTH(m.time) AS res_month, COUNT(p.id) AS res_count FROM uts_match m, uts_player p WHERE $bgwhere AND m.id = p.matchid GROUP by res_month"; $q_gmonths = mysql_query($sql_gmonths) or die(mysql_error()); $month_max = 0; $month_sum = 0; while ($r_gmonths = mysql_fetch_array($q_gmonths)) { $gb_month[$r_gmonths['res_month']] = $r_gmonths['res_count']; if ($r_gmonths['res_count'] > $month_max) $month_max = $r_gmonths['res_count']; $month_sum += $r_gmonths['res_count']; } echo'
|