maham
08-07-2011, 01:18 PM
hello .. can anyone help me in inserting a duplicate entry in database?
Actually i have a table "option" with 3 fields and two of them are set to primary key (composite). I have a poll descriptions in some other table (not concern here) and i have to put that poll's answers in table "option" and obviously when i insert data i should be like this
poll_id answer_id answer_des
1 1 myans_1
1 2 myans_2
1 3 myans_3
the above data means that there is a poll with id=1 and it has 3 answers.
first row is inserted easily but on second time it shows error of duplicate entry .. howdo i avoide it because i cannot remove the tag of primary key from "poll_id" and "field_id" .. Is there is any solution?
Actually i have a table "option" with 3 fields and two of them are set to primary key (composite). I have a poll descriptions in some other table (not concern here) and i have to put that poll's answers in table "option" and obviously when i insert data i should be like this
poll_id answer_id answer_des
1 1 myans_1
1 2 myans_2
1 3 myans_3
the above data means that there is a poll with id=1 and it has 3 answers.
first row is inserted easily but on second time it shows error of duplicate entry .. howdo i avoide it because i cannot remove the tag of primary key from "poll_id" and "field_id" .. Is there is any solution?