我对以下功能有疑问。它只是我认为的加入。通过使用 sql 语句“SELECT * FROM pkw”,我得到了结果。两张表都填满了数据。你看到错误了吗?
function gotoauftrag(id) {
db = window.sqlitePlugin.openDatabase(shortName, version, displayName,maxSize);
var list = '';
var sql = "SELECT DISTINCT p.name FROM pkw p INNER JOIN ta_pkw tp ON tp.pkw_id = p.pkw_id AND tp.ta_id = ?";
db.transaction(function (tx) {
tx.executeSql(sql, [id], function (tx, results) {
if (results.rows.length > 0) {
document.getElementById('auftrag_pkw').innerHTML = '';
for (i = 0; i < results.rows.length; i++) {
r = results.rows.item(i);
list = '<li>'+r['name']+'<span class="ui-li-count">1</span></li>';
document.getElementById('auftrag_pkw').innerHTML += list;
$('#auftrag_pkw').listview('refresh');
}
}
});
});
$('#auftrag_pkw').listview('refresh');
}