0

Alrite so i am trying insert new values into my table, and when i try to, i get the following error

#1062 - Duplicate entry 'Hit Em High' for key 'team_home'

Any idea how to fix this? I've heard it could be a primary key error, but im not sure.

Thanks!

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by rajarajan07
0

You don't provide much info so all we can do is speculate. You should echo your insert statements. For the one that is getting an error, check the key against what is already in the table and you will probably find that there is already a record with that key in the table. How to handle it is up to you. How did the situation happen? Did you run the update process twice in a row or do you possibly have a duplicate in the input? If you find the record is already in the table, do you want to replace it, skip the insert and try the next one or give up? The decision is your's based on your needs.

0

If you entering same values again to a primary key field then it wouldn't allow you to insert the records with duplicates. If you want duplicate then remove the primay key in your sql editor to alter the structure of the table.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.