Android WebSQL PhoneGap未返回插入ID?
我正在使用PhoneGap和WebSql。当我在浏览器上尝试时,一切正常。SQLResultSet对象有3个属性,分别是rows、insertId和rowsAffected。 但是,当我生成和Apk并尝试移动设备时,SQLResultSet对象有两个属性行和rowsAffected。它在移动设备上得到rowsAffected 0,但在pc上的浏览器中得到1。在移动设备上“insertID”未定义Android WebSQL PhoneGap未返回插入ID?,android,cordova,phonegap-plugins,phonegap,web-sql,Android,Cordova,Phonegap Plugins,Phonegap,Web Sql,我正在使用PhoneGap和WebSql。当我在浏览器上尝试时,一切正常。SQLResultSet对象有3个属性,分别是rows、insertId和rowsAffected。 但是,当我生成和Apk并尝试移动设备时,SQLResultSet对象有两个属性行和rowsAffected。它在移动设备上得到rowsAffected 0,但在pc上的浏览器中得到1。在移动设备上“insertID”未定义 db.transaction(function (t) { t.exec
db.transaction(function (t) {
t.executeSql("INSERT INTO TEST (Testname) VALUES (?)", ["test"], function (t, rresult) {
alert(JSON.stringify(rresult));
}, function (t, error) {
alert(error)
})
}, function (error) {
alert("error" + error);
},
function (success) {
alert("success" + success);
})
谢谢你的帮助
下面是表格创建
tx.executeSql("CREATE TABLE IF NOT EXISTS TESTT (Id INTEGER PRIMARY KEY,Testname text)", [],
function (tx, results) { console.log("Successfully created") },
function (tx, error) { console.log("Could not created") }
您是否尝试在设备中调试任何错误跟踪?