SQlite UPDATE操作无法正常工作离子3

时间:2018-10-29 19:08:27

标签: sqlite ionic3

我在使用SQLite数据库的项目中使用ionic 3。除此代码的UPDATE之外,我已经执行了所有其他CRUD操作

this.sqlite.create({
        name: 'nearbye.db',
        location: 'default'
      }).then((db: SQLiteObject)=>{
        db.executeSql('UPDATE chats SET read=? WHERE read=?', ['time','checked']).then(res =>{
             console.log(JSON.stringify(res));
            }).catch(e => alert(JSON.stringify(e)))
        }).catch(e => alert(JSON.stringify(e)));

我在db中的示例数据是

{"id":35,"textFrom":"xxxx","textTo":"xxxx","message":"15","time":1540823439874,"read":"time","image":"","friend":"xxxx"},
{"id":36,"textFrom":"xxxx","textTo":"xxxx","message":"16","time":1540823441705,"read":"time","image":"","friend":"xxxx"}

查询返回{"rows":{"length":0},"rowsAffected":0} 尽管我有符合条件的行。请帮忙!

0 个答案:

没有答案
相关问题