View Single Post
Old 01-24-2007, 12:06 AM  
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
Next question is adding up all rows in a section of a field. for example, i have a field called Total_Income with rows containing numbers like 5, 20, and 9. I would like a script that displays the total income (34). If this can be based on the payment_date containing the "payment month" written down as 04:55:21 Jan 19, 2007 PST it will be two points

So basically,

$query = "SELECT total_income FROM `db` WHERE payment_date **CONTAINS** Jan ORDER BY id DESC";

echo
Total income = total_income_of_jan
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote