我使用ionic4 + angular8 + @ionic-native/sqlite/ngx
您可以插入成功。获取的数据表数量正确,但没有数据
enter image description here有什么问题吗?谢谢
发布于 2020-02-17 21:51:03
您需要像这样读取数据
this.sqlite.create({name: 'myapp.db', location: 'default'}).then((db : SQLiteObject) => {
db.executeSql('SELECT * FROM table_name where id=?', [id]).then((data) => {
let results = []
for (let i = 0; i < data.rows.length; i++) {
let item = data.rows.item(i);
results.push(item);
}
console.log(results)
}).catch(e => console.log(e));
}).catch(e => console.log('sqlite error',e))您将获得results中的所有数据
https://stackoverflow.com/questions/60257412
复制相似问题