Working on a website and require some sales tracking displays...
The primary display I need tracks sales by month for the current year.. the 3 columns I need to fill are:
Year and Month|Type 1 Sales|Type 2 Sales| Total Profit For month
eg: 2001 10 | 1 | 5 | $9999
The info is stord in one table.. the fields i am concerned with are timestamp (format: yyyymmddhhmmss) sales_type (either 1 or 2) sale confirm (needs to be 1 to confirm the sale)..
Basically im trying to get it into an array then just go through the array echoing as needed... prefably the arry will return in the form:
$array['Year-Month']['type1sales']=1
$array['Year-Month']['type2sales']=1
$array['Year-Month']['profits']=5
eg:
$array['2001-10']['type1sales']=1
$array['2001-10']['type2sales']=1
$array['2001-10']['profits']=999
My prob is im going round in circles trying to get all the conditions met in the queries:
Must be grouped by that month.. eg all 2001-20 values together for the current year.. must show all months even if no sales met (so 0s in)..
Please can someone advis eon the queries to build the array I require?
Many thanks in advance...