title: PHPmyAdmin mySQL Trigger: Upddate the parent table when child table was inserted, updated or deleted
body: <p>I need some help with getting the syntax right to define a trigger in PHPmyAdmin.
  What I have:
  2 tables - invoice and invoiceitem
  tbl_invoice has a field 'Total' which should show the sum of the 'Extended' price of the table invoiceitem</p>
  
  <p>tbl_invoiceitem has 2 triggers that update the 'Extended' before_insert and before_update</p>
  
  <p>What I try to accomplish:</p>
  
  <p>Calculate the sum of all items for an invoice and update the 'Total' price in tbl_invoice after either new items are inserted or if the price or quantity for an existing item was updated.</p>
  
  <p>I try to do this in PHPmyAdmin.</p>
  
  <p><a href="https://i.stack.imgur.com/L9hVh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L9hVh.png" alt="enter image description here"></a></p>
  
  <p>The error message is</p>
  
  <p><a href="https://i.stack.imgur.com/uqPl0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uqPl0.png" alt="enter image description here"></a></p>
  
  <p>I hope somebody can give mt a hint into the right direction. Just started with triggers and don't seem to find solution with a couple of days searching the internet.</p>
  
  <p>Thank you for help in advance.</p>
  
  <p>Cheers, Oliver</p>