title: INSERT IF NOT EXIST
body: <p>seems pretty simply but ive tried everything i can find on here and just keep getting an error #1064 - You have an error in your SQL syntax;</p>
  
  <p>every time a user visits the page i want to update a table called range_views</p>
  
  <pre><code>INSERT INTO range_views (range_id, ip_address, view_date) values('112','123.123.123.123','2015-02-01')
  WHERE NOT EXISTS ( SELECT * FROM range_views 
                 WHERE range_id = '112'
                 AND ip_address = '123.123.123.123'
                 AND view_date = '2015-02-01');
  </code></pre>
  
  <p>the table has 4 columns</p>
  
  <pre><code>id - AUTO_INCREMENT
  range_id - INT(6)
  ip_address - VARCHAR(15)
  view_date - VARCHAR(10)
  </code></pre>