title: Correct mysql trigger syntax to prevent infinite loop
body: <p>I am creating the following test trigger to update the value of a field whenever an <code>UPDATE</code> operation occurs:</p>
  
  <pre><code>CREATE TRIGGER `test_index` 
  AFTER UPDATE ON `main_itemmaster` 
  FOR EACH ROW  
      UPDATE `main_itemmaster` SET `guid` = "hello" WHERE `id` = NEW.id; 
  </code></pre>
  
  <p>However, whenever I do an update to this table I get the following error:</p>
  
  <pre><code>Can't update table 'main_itemmaster' in stored function/trigger 
  because it is already used by statement which invoked this stored function/trigger.
  </code></pre>
  
  <p>Why is this occurring and how would I fix this?</p>