All pastes #94196 Raw Edit

Mine

public text v1 · immutable
#94196 ·published 2006-07-21 02:00 UTC
rendered paste body
if($display_entries){
$result = mysql_query("SELECT * FROM tournament order by tickets desc")
or die(mysql_error());

echo border('syellow','start','Entries');
echo '<table cellpadding="0" cellspacing="0"> ';
//echo '<tr>';
while ($row = mysql_fetch_array($result)) {
$name = $row[name];
$item = $row[item];
$quantity = $row[quantity];
$tickets = $row[tickets];
$myhtml = "$row[name] - [item]".$item."[/item] ".'<span>x</span>'." $quantity = $tickets";
echo itemstats_parse('<tr><td class="membersHeader">'.$myhtml.'</td></tr>');
}
echo '</table>';
echo border('syellow','end');
echo "<br>";

$query = "SELECT item, SUM(quantity) FROM $table GROUP BY item"; 
$result = mysql_query($query) or die(mysql_error());
echo border('syellow','start','Totals');
echo '<table cellpadding="0" cellspacing="0"> ';
echo '<tr>';
while ($row = mysql_fetch_array($result)) {
$item = $row[item];
$quantity = $row['SUM(quantity)'];
$myhtml = "[item]".$item."[/item] ".'<span>x</span>'." $quantity";

echo itemstats_parse('<tr><td class="membersHeader">'.$myhtml.'</td></tr>');
}
echo '</tr>';
echo '</table>';
echo border('syellow','end');

}