title: Unexpected IF in MySQL procedure
body: <p>Can anyone tell me what is wrong with the following procedure? MySQL says it is an 'unexpected IF'. I looked up the syntax for an IF statement and I simply don't see what the problem is.</p>
  
  <pre><code>create procedure spInsertAccount
  (
  AccountID INT,
  InUse bit,
  IsBanned bit,
  IsPremium bit,
  IsGolden bit,
  Username VARCHAR(20),
  Password VARCHAR(20),
  Email VARCHAR(65),
  LoggedInID INT,
  CreateDate DATETIME
  )
  
      SET @accountExists = (SELECT * FROM Accounts WHERE AccountID = @AccountID);
  
      IF (accountExists &gt; 0) THEN
  
     INSERT IGNORE INTO Accounts(AccountID, InUse, IsBanned, IsPremium, IsGolden, Username, Password,
                          Email, LoggedInID, CreateDate
                         )
          values (@AccountID, @InUse, @IsBanned, @IsPremium, @IsGolden, @Username, @Password,
                 @Email, @LoggedInID, @CreateDate);
          #where NOT EXISTS( SELECT * FROM Accounts WHERE AccountID = @AccountID);
  
      END IF;
  </code></pre>