(1) The parameter "answer[i]" have 3 parameters values
(2) The "correctAnswer[i]" also have 3 parameters values i.e. one parameter value as 1 and two are null. I tried to assign "0" to null values but my code is inserting into DB only "answer[i]" that has not null "correctAnswer[i]" i.e. one field out of three whereas I want to insert whole 3 fields as 'if they null then 0 and if not null then 1'
Jeanne Boyarsky wrote:Consider what the code looks like with indentation that matches it.
As you can see, this doesn't set the three values with anything. What if you ended the if statement earlier?
[edited to end code block properly]
Thanks for your reply.
I edited as you directed but now not inserting any record. My new code
I think its not a if block problem but related to inserting two arrays at a time. I think when cursor is comming to answer[i] then i=0 but when its comming to correctAnswer[i] then it skipping correctAnswer and working as correctAnswer. This is the real problem. Is that what I think?
Thanks again and profound regards
Joined: Mar 22, 2008
Can anybody please help me as this is 2nd day I stuck and not able to solve the problem.
Thanks again & best regards
author & internet detective