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 Quote 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. Quote 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.. Quote 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? Quote 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 (edited) I get:- CREATE TABLE `ws_bi2_cup_clan_lineup` ( `ID` int... What must I do to get it normal? Thanks for help Edited November 30, 2012 by karimali831 Quote 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? Quote Link to comment https://forums.phpfreaks.com/topic/271356-duplicated-entry/#findComment-1396433 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.