has que la suma la realice la consulta
Código:
CONSULTA SQL
select sum(total) from tabla
Código:
The syntax for the SUM function is:
SELECT SUM(expression )
FROM tables
WHERE predicates;
expression can be a numeric field or formula.
fuente: http://www.techonthenet.com/sql/sum.php