lundi 9 février 2015

Why is this SQLite in JavaScript not working?

I have included SQLite and SQLite statements in my program. I have a table named PILE and I am trying to work with that table.



tx.executeSql(

"UPDATE PILE SET ? = COALESCE( (SELECT ? FROM PILE WHERE word = ?), 0 ) -1 WHERE word = ?",

[category1, category1, incorrectmanualanswer, incorrectmanualanswer] ,
errorcode );

alert("down "+category1+"+"+incorrectmanualanswer);


The above does not execute. I do see the correct values in the following alert window


But the below executes perfectly



function screenONEpress(tx)
{
tx.executeSql(

"UPDATE PILE SET frequency = COALESCE( (SELECT frequency FROM PILE WHERE word = ?), 0 ) + 1

WHERE word = ?", [newEword, newEword] , errorcode );

}

Aucun commentaire:

Enregistrer un commentaire