[SOLVED] Quick Answer? Sum total column in table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
michlcamp
Forum Commoner
Posts: 78
Joined: Mon Jul 18, 2005 11:06 pm

[SOLVED] Quick Answer? Sum total column in table

Post by michlcamp »

I have a table called 'orders' with a column/field for $total

Is there a fast way to: sum($total) by month? (so as to give total sales per month)

Thanks in advance.

mc
User avatar
khaki_monster
Forum Commoner
Posts: 73
Joined: Tue Oct 11, 2005 12:36 am
Location: Philippines
Contact:

Post by khaki_monster »

hi!

i supposed that theirz a field for 'month'... :)

Code: Select all

$tot_sales_permonth = "Select SUM('total_fld') From order GROUP BY month_fld";
cheerz!
michlcamp
Forum Commoner
Posts: 78
Joined: Mon Jul 18, 2005 11:06 pm

Post by michlcamp »

thanks.
Solved.
Post Reply