karimali831 Posted November 29, 2012 Share Posted November 29, 2012 Hey, I can't understand this query failed, it says duplicate entry 0-1-1 which is in the database but I am trying to insert 3-1-1, there is no record for this so why won't it insert? error=Duplicate entry '0-1-1' for key 2 query=INSERT INTO ws_bi2_cup_clan_lineup (ladID, clanID, userID) VALUES ('3', '1', '1') Thanks for any help Link to comment https://forums.phpfreaks.com/topic/271356-duplicated-entry/ Share on other sites More sharing options...
PFMaBiSmAd Posted November 29, 2012 Share Posted November 29, 2012 What's the definition of your database table? The key mentioned in the error is likely using a different 1st column and you have a default value being inserted for that column, which duplicates an existing entry. Link to comment https://forums.phpfreaks.com/topic/271356-duplicated-entry/#findComment-1396210 Share on other sites More sharing options...
karimali831 Posted November 29, 2012 Author Share Posted November 29, 2012 Sorry for not understanding. I am looking at the structure of the database, all having int(11) data types. ID column which is the auto increment cupID column ladID column clanID column userID column I just want to insert values for ladID, clanID and userID. There is definitely not a duplicate entry for the values.. Link to comment https://forums.phpfreaks.com/topic/271356-duplicated-entry/#findComment-1396239 Share on other sites More sharing options...
PFMaBiSmAd Posted November 29, 2012 Share Posted November 29, 2012 The 'official' definition of your database table would have shown the keys, you have two of them, that has been defined for it. What does the query SHOW CREATE TABLE ws_bi2_cup_clan_lineup produce? Link to comment https://forums.phpfreaks.com/topic/271356-duplicated-entry/#findComment-1396241 Share on other sites More sharing options...
karimali831 Posted November 30, 2012 Author Share Posted November 30, 2012 I get:- CREATE TABLE `ws_bi2_cup_clan_lineup` ( `ID` int... What must I do to get it normal? Thanks for help Link to comment https://forums.phpfreaks.com/topic/271356-duplicated-entry/#findComment-1396431 Share on other sites More sharing options...
karimali831 Posted November 30, 2012 Author Share Posted November 30, 2012 I have noticed cupID, clanID and userID has a unique index, is this why? Link to comment https://forums.phpfreaks.com/topic/271356-duplicated-entry/#findComment-1396433 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.