title: How to fix this IF-ELSE-THEN statement in a MySQL trigger
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8397172/how-to-fix-this-mysql-trigger">How to fix this MySQL trigger?</a>  </p>
  </blockquote>
  
  
  
  <pre><code>CREATE TRIGGER Transaction_insert BEFORE INSERT ON Transaction
  FOR EACH ROW
  IF Account.CreditBalance + NEW.Amount &lt; Account.CreditLimit WHERE Number = NEW.AccountNumber THEN
  UPDATE Account SET CreditBalance = CreditBalance + NEW.Amount where Number = NEW.AccountNumber;
  ELSE
  SET NEW.Valid = 0
  END IF; 
  </code></pre>
  
  <p>I get this error message from phpMyAdmin.</p>
  
  <p><img src="https://i.stack.imgur.com/uVloF.png" alt="enter image description here"></p>