This topic is locked
[SOLVED]

 recalculate a table

9/24/2020 2:11:45 AM
PHPRunner General questions
J
Jan author

Hi, I have a table "orders" with the following fields

order_number, amount1, amount2, quantity_pieces, total_amount1, total_amount2, grand_total
I can add articles on another page. The event "after record added" contains PHP code to increase the field "Quantity_pieces" by 1.

The table "orders" must therefore be calculated.
Example Odernr 210: (note: there may be multiple rows)

Update orders ..

totalamount1 = (number pieces amount1)

totalamount2 = (number pieces
amount2)

grand_total = (total_amount1 + total_amount2)

Where order_number = 210
Can someone help me write the correct query? Thanks in advance