title: Using Trigger to update table in another database
body: <p>im using the following trigger to update the user table in another database in mysql 5.0.7
  The creation of trigger gives no error but upon updating the user table in the first database the trigger is not working. Any suggestions?</p>
  
  <pre><code>DELIMITER $$         
  DROP TRIGGER IF EXISTS after_update_user;
  
  CREATE TRIGGER after_update_user;
  
  AFTER UPDATE ON db_test.user  FOR EACH ROW;
  BEGIN
      UPDATE TABLE db_testplus.user;
      SET  name = NEW.name;
  
      WHERE id = NEW.id;
  END
  
  $$
  DELIMITER ;
  </code></pre>
  
  <p>I also used this code without the semicolons but still the same</p>
  
  <pre><code>DELIMITER $$         
  DROP TRIGGER IF EXISTS after_update_user
  
  CREATE TRIGGER after_update_user
  
  AFTER UPDATE ON db_test.user  FOR EACH ROW
  BEGIN
      UPDATE TABLE db_testplus.user
      SET  name = NEW.name
  
      WHERE id = NEW.id
  END;
  
  $$
  DELIMITER ;
  </code></pre>
  
  <p>Finally the code that worked</p>
  
  <pre><code>delimiter |
  DROP TRIGGER IF EXISTS after_update_user|
   CREATE TRIGGER after_update_user AFTER UPDATE ON db_test.user
    FOR EACH ROW BEGIN
       UPDATE db_testplus.user SET name = NEW.name WHERE id = NEW.id;
    END;
  |
  delimiter ;
  </code></pre>