Technote Details :: Adding duplicate values in table
Issue
When I try inserting data into a table, through a MX Kollection generated form, I get an error message saying:
SQL Error: Duplicate entry 'column_name' for key 'key_number'

Reason
This happens because the data you tried to insert into the table is a duplicate of data already existing in the database. Also, the column into which the duplicate value is inserted is set to accept only unique values. Therefore, the insert transaction fails, and the above error message is
Solution
To solve this issue, you can do one of the following:
- Remove the unique attribute from the table column that triggered the error.
- Only insert unique data into the form fields. This way, there will be no duplicates, and thus no error.