title: "INSERT INTO .. ON DUPLICATE KEY UPDATE" Only inserts new entries rather than replace?
body: <p>I have a table, say table1, which has 3 columns: id, number, and name.
  id is auto_incremented.</p>
  
  <p>I want to achieve an sql statement which inserts entries into a table, but if the row already exists, then ignore it.</p>
  
  <p>However,</p>
  
  <p>Every time I run:</p>
  
  <pre><code>INSERT INTO table1( number, name) 
  VALUES(num, name) 
  ON DUPLICATE KEY 
  UPDATE number = VALUES(number), 
         name = VALUES(name)
  </code></pre>
  
  <p>It seems to ignore rows with matching number and name values and appends entries to the end of the table no matter what.</p>
  
  <p>Is there anything I can do to prevent this? I have a feeling it has something to do with having the auto_incrementing primary key?
  thanks</p>