?
Solved

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

Posted on 2008-11-06
9
Medium Priority
?
226 Views
Last Modified: 2012-05-05
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?
0
Comment
Question by:mgtm3
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 6

Accepted Solution

by:
fourice earned 800 total points
ID: 22896475
Perhaps you are trying to insert a record with an already existing key id?
0
 
LVL 15

Assisted Solution

by:MMDeveloper
MMDeveloper earned 400 total points
ID: 22896585
sounds like the column that stores that text, is set to be the index/primary key.
0
 
LVL 36

Assisted Solution

by:Loganathan Natarajan
Loganathan Natarajan earned 400 total points
ID: 22896603
yes, the column field might be set as UNIQUE , just check it
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mgtm3
ID: 22896657
what coulmn are you talking about the one that stores http://kljvxvs.com/files/kk2'   or the on the stores the key 2 ???????
0
 
LVL 6

Assisted Solution

by:fourice
fourice earned 800 total points
ID: 22896720
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?
0
 
LVL 15

Expert Comment

by:MMDeveloper
ID: 22896762
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...."
0
 

Author Comment

by:mgtm3
ID: 22896905
yes one of them is uniqe but the thing that i am tring to insert does not exest in the databse
0
 
LVL 6

Expert Comment

by:fourice
ID: 22896963
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?
0
 
LVL 4

Assisted Solution

by:ScannyR
ScannyR earned 400 total points
ID: 22897325
Can you please post your table structure (including any specified keys) and the query you are trying to execute?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month16 days, 5 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question