> Now to create this I've tried a horrible method of using php to call sql
> table, and then go through each one, and add it to each period of time as
> appropriate. it's messy and slow!

Yes!

To generalize:

ANY time you try to get PHP to access SQL data row by row, and do
something with it (other than spew it to the browser) you are DOING IT
WRONG.

(Does this sound familiar?)

So you've learned your lesson now, and won't do this ever again. :-)

> What I want to do is have the mysql do this.is it possible?

Sure!

But there's no PHP question left here, really.

You want to dig around in MySQL documentation for something called
"sum"... Pretty much what your subject line should have led you to.  In
fact, I daresay if you typed your subject line into Google "SQL sums"
you'd have found the answer... :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to