I am a novice with PHP, I use mssql and am able to use PHP to link to my tables and perform calcultions, but I am unable to determine how to do the following.
I have a table that has order numbers in field one and the item ordered and details about the item in fields 2 and 3 and 4 etc.
I want to be able to show the sum of all of the items in an order.
I know how to calculate across rows, but I can not figure out how to calculate down columns of data by group.
Here is my MSSQL table:
ORDER NUMBER | ITEM NUMBER | QUANTITY | PRICE |
67895 | BR124 | 1 | 2.00
67895 | FG536 | 1 | 2.00
67895 | M56 | 1 | 2.00
67895 | PFHR3 | 1 | 3.00
99678 | XC124 | 1 | 4.00
99678 | SF36 | 1 | 4.00
99678 | VM56 | 1 | 4.00
99678 | YYR3 | 1 | 5.00
I would like to have PHP create a web table using the above table that shows the SUM of all of the items on each order like the following.
ORDER NUMBER | TOTAL ORDER PRICE |
67895 | 9.00
99678 | 17.00