title: What’s causing the syntax error in the IF EXISTS line in my SQL query?
body: <p>I’m running this SQL query:</p>
  
  <pre><code>IF EXISTS (SELECT * FROM score WHERE username='ms')
  UPDATE score SET score='30' WHERE username='ms'
  ELSE 
  INSERT INTO score (username,score) VALUES ('ms','30')
  </code></pre>
  
  <p>but I keep getting this syntax error:</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 <code>IF EXISTS (SELECT * FROM score WHERE username='ms') UPDATE score SET score='30'</code> at line 1</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>