我正在使用以下代码来获取 emp 表中的记录数,代码如下:
var myDb = initDB();
myDb.transaction(function(trans) {
var query = "SELECT COUNT(*) AS c from emp";
trans.executeSql(query, [], function(trans, res) {
var count = res.rows[0].c;
console.log("--- After Count ---"+count);
}, errorHandler); });
The query is giving error : Uncaught TypeError: Cannot read property 'c' of undefined.
How to solve this issue?
Appreciate any help.