Duplicate entry '' for key 2
Moderator: General Moderators
-
shawngoldw
- Forum Contributor
- Posts: 212
- Joined: Mon Apr 05, 2010 3:38 pm
Re: Duplicate entry '' for key 2
and what happened when you did that? Was everything normal or not?
Re: Duplicate entry '' for key 2
Yep all perfectly normal. Im talking to my lead programmer and he thinks it could be something to do with the primary key, but we are stumped!
-
shawngoldw
- Forum Contributor
- Posts: 212
- Joined: Mon Apr 05, 2010 3:38 pm
Re: Duplicate entry '' for key 2
What field are you using for your primary key? And what attributes does it have? Is it auto increment?
Re: Duplicate entry '' for key 2
Primary key are:shawngoldw wrote:What field are you using for your primary key? And what attributes does it have? Is it auto increment?
Address
Website
Description
(dont know why there primary)
and auto increment is:
ID.
Hope this helps
-
shawngoldw
- Forum Contributor
- Posts: 212
- Joined: Mon Apr 05, 2010 3:38 pm
Re: Duplicate entry '' for key 2
I assume that the composite primary key is also set to be unique?
When you were saying that it works for you and not everyone else, I assume you were always the first to try? When you insert into your database you do not set any of those 3 fields. If they are supposed to be unique, then that explains it telling you the key is a duplicate since somebody being inserted after you is given the same default values for address, website, and description.
Does this sound right?
Also, that seems like an odd choice for your primary key, if you have an auto increment id that is what is generally chosen to be the primary key. I don't know your exact situation and database schema so I can not tell you what your doing is not right though.
London england or ontario?
Shawn
When you were saying that it works for you and not everyone else, I assume you were always the first to try? When you insert into your database you do not set any of those 3 fields. If they are supposed to be unique, then that explains it telling you the key is a duplicate since somebody being inserted after you is given the same default values for address, website, and description.
Does this sound right?
Also, that seems like an odd choice for your primary key, if you have an auto increment id that is what is generally chosen to be the primary key. I don't know your exact situation and database schema so I can not tell you what your doing is not right though.
London england or ontario?
Shawn