I have a database that has a collection of several rows with data like this:
Username: BillyBob
TotalPrice: 19.99
CreationDate: 2012-02-20 14:30:58
I need to do a SQL Statement in PHP that does something like this.
$sql = mysql_query(" Add up Total Price Where Username='BillyBob' Where CreationDate is within this month ");
How would I do something like that. I also want to do things like, Last 30 Days, Last Week, Specific Date Range etc..
Is that possible?
Just need to add handling for errors and inputs (returns total for given month), you will just need to alter the monthStart and monthEnd logic / values with whatever period you are interested in.