title: mysql trigger after update multiple another table
body: <p>I have 2 tables</p>
  
  <p>"description_acc_all_lang" -  this contains translations of text in 15 languages each field is the language translation</p>
  
  <pre><code>CREATE TABLE `description_acc_all_langs` (&lt;br&gt;
    `code` varchar(4) NOT NULL,(&lt;br&gt;
    `en_desc` varchar(256) NOT NULL,&lt;br&gt;
    `fr_desc` varchar(256) NOT NULL,&lt;br&gt;
    `es_desc` varchar(256) NOT NULL,&lt;br&gt;
    `pt_desc` varchar(256) NOT NULL,&lt;br&gt;
    `da_desc` varchar(256) NOT NULL,&lt;br&gt;
    `de_desc` varchar(256) NOT NULL,&lt;br&gt;
    `nl_desc` varchar(256) NOT NULL,&lt;br&gt;
    `no_desc` varchar(256) NOT NULL,&lt;br&gt;
    `sv_desc` varchar(256) NOT NULL,&lt;br&gt;
    `fi_desc` varchar(256) NOT NULL,&lt;br&gt;
    `pl_desc` varchar(256) NOT NULL,&lt;br&gt;
    `it_desc` varchar(256) NOT NULL,&lt;br&gt;
    `ru_desc` varchar(256) NOT NULL,&lt;br&gt;
    `cs_desc` varchar(256) NOT NULL,&lt;br&gt;
    `hu_desc` varchar(256) NOT NULL,&lt;br&gt;
    PRIMARY KEY  (`code`)&lt;br&gt;
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  </code></pre>
  
  <p>A single record from this table</p>
  
  <pre><code>+------+-------------------------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+&lt;br&gt;
  | code | en_desc                             | fr_desc | es_desc | pt_desc | da_desc | de_desc | nl_desc | no_desc | sv_desc | fi_desc | pl_desc | it_desc | ru_desc | cs_desc | hu_desc |&lt;br&gt;
  +------+-------------------------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+&lt;br&gt;
  | hs   | 30 minutes drive to big supermarket |         |         |         |         |         |         |         |         |         |         |         |         |         |         |&lt;br&gt;
  +------+-------------------------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
  </code></pre>
  
  <p>code  - is the up to 4 letter unique code<br>
  en_desc  - is the English text<br>
  fr_desc  - is the French text<br>
  es_desc  - is the Spanish text<br>
  .._desc  - is the ....... text<br>
  etc<br>
  <br>
  <br></p>
  
  <p>The 2nd table contains multiple records - one for each of the 15 language descriptions</p>
  
  <pre><code>code - 4 letter code this is &lt;br&gt;
  desc - Text string - this needs to be updated from the xx_desc field in the "description_acc_all_langs" table lang - 2 letter country code.
  
  
  
  CREATE TABLE `description_acc` (&lt;br&gt;
    `acc_id` int(11) NOT NULL auto_increment,&lt;br&gt;
    `code` varchar(10) collate utf8_unicode_ci default NULL,&lt;br&gt;
    `desc` varchar(255) collate utf8_unicode_ci default NULL,&lt;br&gt;
    `lang` varchar(2) collate utf8_unicode_ci NOT NULL,&lt;br&gt;
    PRIMARY KEY  (`acc_id`),&lt;br&gt;
    UNIQUE KEY `codelang` (`code`,`lang`)&lt;br&gt;
  ) ENGINE=MyISAM AUTO_INCREMENT=211 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  </code></pre>
  
  <p>Extract from table showing all records for code "hs" in all languages</p>
  
  <pre><code>+--------+------+-----------------------------------------------------------------------+------+
  | acc_id | code | desc                                                                  | lang |&lt;br&gt;
  +--------+------+-----------------------------------------------------------------------+------+&lt;br&gt;
  |     25 | hs   | 30 minut jÃ­zdy do velkÃ½ch supermarketÅ¯                             | cs   |&lt;br&gt;
  |     18 | hs   | 30 minutters kÃ¸rsel til stort supermarked                            | da   |&lt;br&gt;
  |     26 | hs   | 30 Minuten Fahrt zum Supermarkt                                       | de   |&lt;br&gt;
  |     14 | hs   | 30 minutes drive to big supermarket                                   | en   |&lt;br&gt;
  |     28 | hs   | 30 minutos en coche de grandes supermercados                          | es   |&lt;br&gt;
  |     21 | hs   | 30 minuutin ajomatkan suuri supermarket                               | fi   |&lt;br&gt;
  |     27 | hs   | 30 minutes en voiture au grand supermarchÃ©                           | fr   |&lt;br&gt;
  |     23 | hs   | 30 perc autÃ³Ãºtra a nagy szupermarket                                | hu   |&lt;br&gt;
  |     17 | hs   | 30 minuti di auto a grande supermercato                               | it   |&lt;br&gt;
  |     15 | hs   | 30 minuten rijden naar grote supermarkt                               | nl   |&lt;br&gt;
  |     19 | hs   | 30 minutters kjÃ¸retur til store supermarked                          | no   |&lt;br&gt;
  |     24 | hs   | 30 minut jazdy na duÅ¼y supermarket                                   | pl   |&lt;br&gt;
  |     16 | hs   | 30 minutos de carro de um supermercado grande                         | pt   |&lt;br&gt;
  |     22 | hs   | 30 Ð¼Ð¸Ð½ÑÑ ÐµÐ·Ð´Ñ Ð´Ð¾ Ð±Ð¾Ð»ÑÑÐ¾Ð³Ð¾ ÑÑÐ¿ÐµÑÐ¼Ð°ÑÐºÐµÑÐ°           | ru   |&lt;br&gt;
  |     20 | hs   | 30 minuters bilfÃ¤rd till stora snabbkÃ¶p                             | sv   |&lt;br&gt;
  +--------+------+-----------------------------------------------------------------------+------+&lt;br&gt;
  15 rows in set (0.00 sec)&lt;br&gt;
  </code></pre>
  
  <p>My trigger needs to update the record in each of the "area_description_acc" language records if a single field is updated in "area_description_acc_all_langs"<br>
  <br>
  So in effect "area_description_acc_all_langs" contains all the translations and 1 code identifier in a single record, the "area_description_acc" contains 15 individual records for each of the 15 languages per code with a field "code" to identify it and a language identifier field "lang" <br>
  <br>
  <br></p>
  
  <p>I started to try and understand how triggers are constructed but am just tying myself in knots<br></p>
  
  <pre><code>delimiter //
  Create trigger update_all_recs
  after update on description_acc_all_langs
  for each row
  begin
    update area_description_acc
    set desc = new.en_desc
    where members_house_area_description_acc_all_langs.code=members_house_area_description_acc.code;
      end//
  
  delimiter ;
  </code></pre>
  
  <p>Any help on how to contruct the trigger would help me understand, I have chopped up many examples but after 2 days and too much coffee I think I need guidance and maybe some therapy.
  Regards.</p>