At least two possibilities:
1) If you need to have duplicate values in that column, get rid of the unique key
2) if the values in that column must be unique, don't insert a duplicate value
If the value has to be unique, and the duplicate value comes from user input, then you could show a message to the user when the query returns a duplicate key error.
Bookmarks