I am having a weird error and I've spent my whole day just to figure it out my self but I give up :) The code below is in a function that gets data from an SQLite database and assign the results in a multidimensional array then the function returns this array. This actually works but when the rows from the database is 3 and above the error below shows. I'm sure the assigned values for each is consistent throughout the loop because I tried to use typeof to know the type. Please help me. Thanks!
TypeError: Type error
var db = openDB();
var arrItems = [[],[]];
db.transaction(function(tx) {
var rs = tx.executeSql('SELECT * FROM items WHERE category=?;', [txtcategory]);
arrItems.length = rs.rows.length;
for(var i = 0; i < rs.rows.length; i++) {
arrItems[i][0] = rs.rows.item(i).category;
arrItems[i][1] = rs.rows.item(i).date;
arrItems[i][2] = rs.rows.item(i).descr;
arrItems[i][3] = rs.rows.item(i).descrlong;
arrItems[i][4] = rs.rows.item(i).value;
}
}