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[23000]: Integrity constraint violation: 1062 Duplicate entry 'FI' for key 'cc_fips'
I have logged the query , and it is this one :
- INSERT INTO
country
(cc_fips
,cc_iso
,tld
,country_name
,active
) VALUES (?, ?, ?, ?,
Why is it inserting a new record instead of updating the selected one?