title: Wamp, MYSQL and ON DUPLICATE KEY UPDATE not affecting correct number of rows?
body: <p>I have a mysql <code>ON DUPLICATE KEY UPDATE</code> statement that is running successfuly.</p>
  
  <p>Although in the manual it says that for a row inserted the affected rows is 1 and an updated row is 2. I figured I could work out the number of inserted rows by simply doing;</p>
  
  <pre><code>$i = count($insert); // the insert array
  // execute the query here
  $inserted = ($i * 2) - $q -&gt; rowCount();
  </code></pre>
  
  <p>The equation that equals <code>$inserted</code> returns the number of inserted rows (according to mysql).</p>
  
  <p>Though on my laptop running wamp, when inserting with only duplicate values I get a row count of 0! Why could this be?</p>
  
  <p>Thanks</p>