Topic: find the sum of column values (Read 686 times)
aka J Love Community Supporter?
Bill Gates is my home boy
Gender:
Posts: 884
1636 credits Members referred : 4
« on: Sep 08, 2006, 07:27:11 PM »
say i have this table, fusion_hiscores. one of the field values for each row in this table is "player_cmb" i want to find all the values for player_cmb, say 1 row is 110 and the next row is 20, and another one is 120. that is the only 3 in the table, so i want a function that finds all these values no matter how many rows exist, and then add them all together. how would i go about doing this? this is what i am trying:
Code:
<?php
$input = dbresult(dbquery("SELECT player_cmb FROM ".$db_prefix."hiscores"), 0);