i get this error eatch time i try to insert this Duplicate entry 'http://kljvxvs.com/files/kk2' for key 2

why when i try to insert data to mysql i get this error

Duplicate entry 'http://kljvxvs.com/files/kk2' for key 2
if try to insert http://kljvxvfdsfdsfds2 for key 2
why is this?
Who is Participating?
fouriceConnect With a Mentor Commented:
Perhaps you are trying to insert a record with an already existing key id?
MMDeveloperConnect With a Mentor Commented:
sounds like the column that stores that text, is set to be the index/primary key.
Loganathan NatarajanConnect With a Mentor LAMP DeveloperCommented:
yes, the column field might be set as UNIQUE , just check it
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

mgtm3Author Commented:
what coulmn are you talking about the one that stores http://kljvxvs.com/files/kk2'   or the on the stores the key 2 ???????
fouriceConnect With a Mentor Commented:
Look at your table structure. The table you are inserting the record to must have 1 or more fields. Is one of those fields set as UNIQUE? You can use PhpMyAdmin to find this out.
Also what is the code part that inserts this into the db?
unless I'm mistaken, I think key 2 means it's the second column of the table, which is probably the one that contains the string "http...."
mgtm3Author Commented:
yes one of them is uniqe but the thing that i am tring to insert does not exest in the databse
Perhaps showing some code, the table structure and table content could be of help.
Are you also sure there is no other field which is the same? Like a key or something?
ScannyRConnect With a Mentor Commented:
Can you please post your table structure (including any specified keys) and the query you are trying to execute?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.