altarek — 2012-02-08T04:43:13-05:00 — #1
i have this error
DB Error: Duplicate entry 'root' for key 2 : DB Error: Duplicate entry 'root' for key 2
guido2004 — 2012-02-08T04:49:41-05:00 — #2
You are trying to insert a value ('root') that already exists in the second unique key you've specified when creating the table.
altarek — 2012-02-08T04:52:11-05:00 — #3
i don't know how to solve that,
guido2004 — 2012-02-08T05:53:09-05:00 — #4
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.