This question is locked. New answers and comments are not allowed.
Hi guys ,
im developping an cross-platforms app (with latest cordova version) and i'm using your verified sqlite plugin i installed it via CLI as written in the documnetation .
when i try to open the database and make sure the table is created and
if has some data i can't and in the console i don't get any error except
(DB opened !! no error nothing
this is my code :
1.
db = window.sqlitePlugin.openDatabase({name:
"products.db"
,location:
'default'
,androidLockWorkaround: 1},
function
(tx) db.transaction(
function
(tx) { tx.executeSql(
'CREATE TABLE IF NOT EXISTS products (id integer primary key, product_id INTEGER,title text,price text, picture text,quantite INTEGER)'
),
function
(tx,res){alert(res)},
function
(e) { alert(
'error: '
+ e.message);}});
1.
db.transaction(
function
(tx){
2.
tx.executeSql(
"SELECT count(id) as cnt FROM products"
),
3.
function
(tx,res){
4.
alert(res.rows.item(0).cnt);
5.
},
function
(e) {
6.
showNotification(
'error: '
+ e.message);
7.
}