Here is the request itself
$query = ("REPLACE INTO`" . DB_PREFIX . "archive_sum_back_newposhta` SET name_sender = '" . $this->db->escape($list_data[$key]['name_sender']). "', sum_back = '" . $this->db->escape($list_data[$key]['sum_back']) . "' "); fields in the database
id_archive int(11) AUTO_INCREMENT PRIMARY KEY name_sender varchar(255) UNIQUE sum_back varchar(255) When so the records are not duplicated but the id changes (that is, there were 2 entries id = 1, id = 2 and after adding repeated entries id changed to id = 3 id = 4) how to fix that id would change?
insert ... on duplicate key updateinstead of replace - Mike