Page 1 of 1

Duplicate entry?

Posted: Thu Mar 22, 2007 1:42 pm
by GeXus
I'm receiving the following error
Duplicate entry 'xxxxx' for key 2
But, it is not a duplicate, if i do the exact same insert statement from command line it works... (and then i deleted it to try again).. and when i select on it, there is none existing..

Any idea why I would get this error?

Posted: Thu Mar 22, 2007 4:03 pm
by feyd
Are you sure you're looking at the correct key?

Posted: Thu Mar 22, 2007 4:09 pm
by GeXus
There are only two keys and one is auto_increment so there is only one option

Posted: Thu Mar 22, 2007 5:08 pm
by Kieran Huggins
post your query?

Posted: Thu Mar 22, 2007 5:18 pm
by GeXus

Code: Select all

insert into review (user, review, date) values ('testuser', 'this is a test review', now())
there is a review_id that is auto increment and user is unique.

Posted: Thu Mar 22, 2007 5:20 pm
by Kieran Huggins
Is `user` a key/unique?

Posted: Thu Mar 22, 2007 5:30 pm
by GeXus
I got it, it's because i'm using cascading. Thanks anyways!