I have a database query that returns rows into a local array:
for (var i=0; i < results.rows.length; i++)
{
localResultsArray[i] = results.rows.item(i);
}
Later on, I want to update a value in the local array that corresponds to the 'answered_correctly' column in my database, but this value is not being updated. My code is:
localResultsArray[currentQuestionNumber].answered_correctly = 1;
but this doesn't change the value in the array to 1 for some reason - what am I doing wrong?
(Incidentally, if I do a comparison, eg. in an if statement then it works, so I must be using the wrong syntax above??)
if (localResultsArray[currentQuestionNumber].answered_correctly == 2)
{
incrementMe++;
}
Thanks in advance! Nick.