Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Phonegap sqlite更新查询不工作_Sqlite_Cordova - Fatal编程技术网

Phonegap sqlite更新查询不工作

Phonegap sqlite更新查询不工作,sqlite,cordova,Sqlite,Cordova,我有一个更新查询,其中在我将布尔列更新为true时,它进入成功回调,但当我获取相同的值时,它是false。 下面是我的代码片段: db.transaction(function(tx){ tx.executeSql("update `"+UsersT+"` set "+LoggedInC+" = 'true' where "+UserIdC+" = '18' ", [], function(tx,res){ alert("it goes here"

我有一个更新查询,其中在我将布尔列更新为true时,它进入成功回调,但当我获取相同的值时,它是false。 下面是我的代码片段:

    db.transaction(function(tx){
        tx.executeSql("update `"+UsersT+"` set "+LoggedInC+" = 'true' where "+UserIdC+" = '18' ", [], function(tx,res){
            alert("it goes here");
            getUser();
        }, function(err){
            alert("Error code: "+err.code);
        });
    }, function(err){});


function getUser(){
    db.transaction(function(tx){
        tx.executeSql("select * from `"+UsersT+"` where "+UserIdC+" = 18 ", [],function(tx, res){
            alert(res.rows.length+" | "+res.rows.item(0).logged_in+" | "+res.rows.item(0).uid);
        }, function(err){alert("Error: "+err.code);});
    }, function(err){});
}
谢谢

有什么帮助吗