Hey guys,
I am trying to add all of the values together that are in a column of my table. Is there any built in function for this in php or mysql? I am having trouble trying to create my own with php.
Thanks,
Ben
try this:
select sum(YOUR_COLUMN) from BLABLABLA;
Allmost:
SELECT SUM(your_column) AS a_name_you_can_remember FROM your_table;
Note that this runs as a seperate query. If you are printing the rows already, you mioght aswell just add the values manually: $iTotal+=$iValue_from_row
Hey thanks alot, it worked great