'Use SQL or/and PHP in order to SUM a quantity and insert the values into the table
I need these tables to be updated permanently, not a sort by or a group by to show the quantitys, after I run the commands or use PHP i need the table it self to be manipulated have the updated values, so I can click on and off the table itself and the table will have been manipulated, thank you for reading.
Current table:
| Names | Quantity |
|---|---|
| James | 1 |
| James | 1 |
| James | 1 |
| Julia | 1 |
| Julia | 1 |
| Jamie | 1 |
What I want:
| Names | Quantity |
|---|---|
| James | 3 |
| Julia | 2 |
| Jamie | 1 |
I am using SQL however it is a WebApp that im using PHP for another part of it, so I don't mind going down that route if needed
I have already tried using "SUM" however this only temporarily changes the table, I need certain commands I can use so the table stays with the updated quantities.
Any ideas would be amazing, thank you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
