Sorry, I'm totally befuddled as to what you need. Even more confused wrt table and how it's used.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
Ok -
1: count no. of users using COUNT() and store as a php variable.
2. sum each individual field and take out the number of users.
I hope that's right.
//$num_users is number of users obviously.
$rs = mysql_query("SELECT SUM(field1), SUM(field2), SUM(field3), SUM(field4) ... FROM table");
$fieldnames = array("hat1","hat2","mask2"...);
$i = 0;
$row = mysql_fetch_array($rs);
foreach($row AS $rowitem){
$rowitem = $rowitem - $num_users;
echo "<td>{$fieldnames[$i]}? $rowitem</td>";
$i++;
}
//NOT TESTED OR ANY DB ERROR HANDLING!
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
That's what I tried to provide - did you try it?
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
mysql_query("SELECT SUM('scout'), SUM('soldier'), SUM('pyro'), SUM('demoman'), SUM('heavy'), SUM('engineer'), SUM('medic'), SUM('sniper'), SUM('spy') FROM things");
try:
mysql_query("SELECT SUM(scout), SUM(soldier), SUM(pyro) ...);
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080