This question has already been answered:
How to organize a condition check when adding a record to the database?
If the database already has a similar name, then instead of adding a new line (duplicate), just update some values first.
Suppose there are 3 columns in the database (id, name, date). I need to check when writing new lines: for example, since there is a line called "bla-bla", then do not create a new "bla-bla" with a new ID, but simply change the date in the first "bla-bla" to new and all.
It was ('100', 'bla-bla', '08.01.2016 10:00')
It became ('100', 'bla-bla', '08.01.2016 10:47')
идfield (probably a synthetic primary auto-increment key?), If there is a deliberately unique (if you believe the question wording itself) fieldимя? And does it make sense to update the data, obviously losing the change history? - Akina