Page 1 of 1

Math with PHP/MySQL

Posted: Thu Feb 07, 2008 6:14 pm
by cupaball
Hi All:

Quick question, I have a table with the number of people coming to a party and I would like to display the results (easy enough, right). That part I am having a challenge with is adding the total number at the bottom of the results. Can someone point me in the direction of a tut?

Re: Math with PHP/MySQL

Posted: Thu Feb 07, 2008 6:27 pm
by Christopher
You can add them up as you loop through the rows to display the data. Or you can use the SUM() function in SQL. See the MySQL docs for examples.