title: On duplicate key update not working
body: <p>I try to use  <strong>on duplicate key update</strong> in my query but it still duplicate some value.</p>
  
  <p>My query is like this: </p>
  
  <pre><code> $insert=mysqli_query($conn,"insert into tbl_staffdistribution(db_user,db_name,db_responsible,db_date)values('$user','$name','$responsible','$formatteddatetimein') on duplicate key update db_user='$user',db_name='$name',db_responsible='$responsible',db_date='$formatteddatetimein'")or die(mysqli_error($conn));
  </code></pre>
  
  <p>I have <strong>db_id</strong> in my database is a primary key auto increment.</p>
  
  <p>The problem is that I have a duplicate value in my database and that should not happen How can I solve this problem ??</p>