title: MYSQL Trigger Not Working. Not sure why
body: <p>I am trying to create a trigger for my table named quailmiles.  When the total miles hits a certain number I want the persons status (which is a attribute in that same table) to change.  For some reason my code is not working.</p>
  
  <p>The error currently reads:</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 '' at line 9.</p>
  </blockquote>
  
  <pre><code>delimiter $$
  CREATE TRIGGER status_update 
  AFTER UPDATE ON quailmiles
  FOR EACH ROW BEGIN
  IF (total_miles &gt; 2000) THEN
      UPDATE quailmiles SET status = 'gold';
  ELSE IF (total_miles &gt; 4000) THEN
      UPDATE quailmiles SET status = 'platinum';
  END IF;
  END $$
  delimiter;
  </code></pre>