我想从本地存储中搜索,ionic2的sqlite查询将是此 - 从本地存储中搜索数字的SQL查询将是什么?像这样的东西从mytable中选择row_id,例如 *喜欢'%searched_text%';
var searchmobile=newvalue
this.database.executeSql("SELECT mobile_no FROM customer WHERE mobile_no like ?",
[searchmobile]).then((customerdata) =>
尝试串联searchmobile
喜欢:
var searchmobile=newvalue
this.database.executeSql("SELECT mobile_no FROM customer WHERE mobile_no like ?",
['%' + searchmobile + '%']).then((customerdata) =>
您需要在执行查询之前打开数据库
`var searchmobile=newvalue
this.database = new SQLite();
this.database.openDatabase({
name: "data.db",
location: "default"
}).then(() => {
this.database.executeSql("SELECT mobile_no FROM customer WHERE mobile_no like ?",
[searchmobile]).then((customerdata) =>`