Thanks for the quick reply!
I feel like I'm doing this completely incorrectly. This query gives me an array? Or what? I'm a complete noob at this, so here is my feeble attempt. I used the SQL that you gave me...
PHP Code:
$result= mysql_query("
SELECT usergroupid, SUM(userfield16) AS total FROM " . TABLE_PREFIX . "user
LEFT JOIN " . TABLE_PREFIX . "userfield USING (userid)
GROUP BY usergroupid
") or die(mysql_error());
$points = mysql_fetch_array($result);
$group1= $points[0];
$group2= $points[1];
$group3= $points[2];
$group4= $points[3];
But I get this error...
Code:
Unknown column 'userfield16' in 'field list'
What am I doing wrong? What do I need to change? If I know that the usergroupid values that I need to sum up the points are 11, 12, 13, and 14, does that make it any easier? Is there perhaps some other approach that I can take to this with that knowledge?
Thanks!