my database will look like this in this format.
id cid values 1 1 value1 2 1 value2 3 1 value3
I ask you to advise. How to implement it?
My request:
tx.executeSql("SELECT cid,value FROM table where cid="+cid_value, [], querySuccess, errorCB,cid_value);
This is the code I used
value=val[1]; var causedetails = results.rows.length; for (var i=value; i<causedetails; i++) { cidinstance=results.rows.item(i).cid; console.log("cid= "+cidinstance ); var valueinstance=results.rows.item(i).value; //document.getElementById("s1cause").innerHTML=valueinstance; console.log("cid= "+cidinstance + "" + "valueinstance= "+valueinstance); }
when val [1} = 0, it worked perfectly, all values ββwere printed.
The problem began with the following situation: when val [1] = 1 or 2, .... so when val [1] = 1, in fact, it has only 2 values. But when I printed it in the console log, 1 value was visible after that, I see an error
JSCallback: Message from Server: SQLitePluginTransaction.queryCompleteCallback(value1,value2)
Where is the mistake, please guide me.
console.log print
when value = 0
05-16 13:42:59.062: I/Web Console(10351): cid= 1 valueinstance= VALUE 1 of cid 1 at file:///android_asset/www/abc.html?var%20id=0:181 05-16 13:42:59.062: I/Web Console(10351): cid= 1 valueinstance= VALUE 2 of cid 1 at file:///android_asset/www/abc.html?var%20id=0:181 05-16 13:42:59.062: I/Web Console(10351): cid= 1 valueinstance= VALUE 3 of cid 1 at file:///android_asset/www/abc.html?var%20id=0:181 05-16 13:42:59.062: I/Web Console(10351): cid= 1 valueinstance= VALUE 4 of cid 1 at file:///android_asset/www/abc.html?var%20id=0:181
when value = 1
05-16 13:49:36.765: I/Web Console(11184): cid= 2 valueinstance= VALUE 2 of cid 2 at file:///android_asset/www/abc.html?var%20id=0:181 05-16 13:49:36.769: I/Web Console(11184): JSCallback: Message from Server: SQLitePluginTransaction.queryCompleteCallback('1368692376635000','1368692376639000', [{"value":"VALUE 1","id":"5","cid":"2"},{"value":"VALUE 2","id":"6","cid":"2"}]); at file:///android_asset/www/cordova-2.1.0.js:3726
SCRIPT in cordova2.1.js
function startXhr() {
The problem is that I get values ββwhen I receive a message from the server as JS Callback. not out of for loop
CAN ANYBODY HELP ME WITH THIS, PLEASE