escape($roster_conf['server_name']); $guild_name_escape = $wowdb->escape($roster_conf['guild_name']); $display_entries = $_REQUEST['show_all_entries']; $display_ranks = $_REQUEST['show_ranks']; if($display_entries){ $result = mysql_query("SELECT * FROM tournament order by tickets desc") or die(mysql_error()); echo border('syellow','start','Entries'); echo ' '; echo ''; while ($row = mysql_fetch_array($result)) { $name = $row[name]; $item = $row[item]; $quantity = $row[quantity]; $tickets = $row[tickets]; $myhtml = "$row[name] - [item]".$item."[/item] ".'x'." $quantity = $tickets"; echo itemstats_parse(''); } echo '
'.$myhtml.'
'; echo border('syellow','end'); echo "
"; mysql_free_result($result); $query = "SELECT item, SUM(quantity) FROM tournament GROUP BY item"; $result = mysql_query($query) or die(mysql_error()); echo border('syellow','start','Totals'); echo ' '; echo ''; while ($row = mysql_fetch_array($result)) { $item = $row[item]; $quantity = $row['SUM(quantity)']; $myhtml = "[item]".$item."[/item] ".'x'." $quantity"; echo itemstats_parse(''); } echo ''; echo '
'.$myhtml.'
'; echo border('syellow','end'); } if($display_ranks){ $query = "SELECT name, SUM(tickets) AS Sum_Tickets FROM $table GROUP BY name order by Sum_Tickets DESC"; $result = mysql_query($query) or die(mysql_error()); echo border('syellow','start', 'Ranking'); echo ' '; // Print out result while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo ""; } echo "
"; echo $row['name']; echo ""; echo $row['Sum_Tickets']; echo "
"; echo border('syellow','end'); } ?>