What kind of DB are you using? If it's SQL-driven, you can define some constrains on the table level protecting from duplicates, like a composite
UNIQUE KEY.
Generally, if you can detect duplicates AFTER adding the data to DB, you can detect them BEFORE you add the data to DB, and display a warning.
s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print