title: Mysql on duplicate key update is not working
body: <p>I am trying to use following code segment to update the database when inserting duplicates. But instead of updating it still inserting duplicate rows. Why?</p>
  
  <pre><code>$import = "INSERT INTO data(Product,Courier,Received_Date,Acc_No,Received_By,Delivered_Date,Month,Year,Bill_Run,Dispatch_Type,Status,Bounce_Code) values('$data[0]','$data[1]','$Received_Date','$data[3]','$data[4]','$Delivered_Date','$data[6]','$data[7]','$data[8]','$data[9]','$data[10]','$data[11]') ON DUPLICATE KEY UPDATE Acc_No = '$data[3]'
  </code></pre>