I am trying to execute this siple query:
- $update = $this->modelsManager->executeQuery("UPDATE Country SET active = '1' WHERE cc_fips = '$enteredcountry'");
But i get thiss error:
- SQLSTATE: Integrity constraint violation: 1062 Duplicate entry 'FI' for key 'cc_fips'
I have logged the query , and it is this one :
- INSERT INTO
active) VALUES (?, ?, ?, ?,
Why is it inserting a new record instead of updating the selected one?