title: if and col_length syntax
body: <p>Statement :</p>
  
  <pre><code>if col_length('memes', 'rating_test') is null 
      begin 
      alter table `memes` add column `rating_test` varchar(36) 
      end  
  </code></pre>
  
  <p>Error message :</p>
  
  <blockquote>
    <p>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 '<code>if col_length('memes', 'rating_test') is null begin alter table `memes` add colu</code>' at line 1</p>
  </blockquote>
  
  <p>Why is the above error message being generated?</p>