Prevent InnoDB auto increment ON DUPLICATE KEY
I am currently having problems with a primary key ID which is set to auto increment . It keeps incrementing ON DUPLICATE KEY . For Example: ID | field1 | field2 1 | user | value 5 | secondUser | value 86 | thirdUser | value From the description above, you'll notice that I have 3 inputs in that table but due to auto increment on each update, ID has 86 for the third input. Is there anyway to avoid this ? Here's what my mySQL query looks like: INSERT INTO table ( field1, field2 ) VALUES (:value1, :value2) ON DUPLICATE KEY UPDATE field1 = :value1, field2 = :value2 And here's what my table looks