title: Creating a delete trigger
body: <p>I have a table called <code>ul_logins</code> and a table called <code>userbase</code> and <code>userchanges</code>. I know, want, whenever I delete some user from <code>ul_logins</code> a trigger to automatically delete the same user from <code>userbase</code> and <code>userchanges</code>. The id of the user is <code>id</code> at <code>ul_logins</code> and <code>userID</code> at <code>userbase</code> and <code>userchanges</code></p>
  
  <p>I have written this trigger in mysql (phpmyadmin)</p>
  
  <pre><code>CREATE OR REPLACE TRIGGER deleteUser AFTER DELETE ON ul_logins
  FOR EACH ROW BEGIN
  DELETE FROM userbase WHERE userID = :old.id;
  END
  </code></pre>
  
  <p>But it doesn't work, I get an error all the time. But I just can't find what the problem is</p>
  
  <blockquote>
    <p>#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to
    use near 'TRIGGER deleteUser AFTER DELETE ON ul_logins
    FOR EACH ROW BEGIN
    DELETE FROM us' at line 1 </p>
  </blockquote>
  
  <p>I already googled and there was another solution and tried this</p>
  
  <pre><code>DELIMITER |
  
  CREATE OR REPLACE TRIGGER deleteUser AFTER DELETE ON ul_logins
  FOR EACH ROW BEGIN
  DELETE FROM userbase WHERE userID = :old.id;
  END;|
  
  DELIMITER ;
  </code></pre>
  
  <p>but this didn't work neitehr. Any suggestions?</p>