Page 1 of 1

Need help with a rating script

Posted: Thu Aug 16, 2007 2:17 am
by RhapX
Hello,

I am writing a script for a rating system and it seems that the only thing I can't figure out is how to add up all the cells. I have a cell named review_rating and want to add up all the values in that cell.

For instance, I have 4 rows of rating values (1, 3, 5, 3). All together they should add up to be 12. How would I add those together?

I am pulling them in an array through an SQL query.

Posted: Thu Aug 16, 2007 2:20 am
by s.dot

Code: Select all

SELECT SUM(`table_field`) FROM `table`

Posted: Thu Aug 16, 2007 2:22 am
by RhapX
Thanks!