title: MySQL: insert where not exists
body: <p>I'm trying to insert new user if not exist in users table, I tried this query but receive error:</p>
  
  <pre><code>INSERT INTO USER (name,email)
  VALUES ('John','john@mmm.com')
  WHERE NOT EXISTS
      (SELECT id FROM USER WHERE email = 'john@mmm.com')
  </code></pre>
  
  <p>how to insert user if not exists ?</p>
  
  <p>error:</p>
  
  <pre><code>#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 'where not exists (select id from user where email = 'john@mmm.com')' at line 5
  </code></pre>
  
  <p>thanks,</p>