Dexter1997
Neues Mitglied
Folgender Fehler:
"footbar" und "logmsg" werden wie gewünscht ausgegeben, allerdings nicht "Hallo"
"footbar" und "logmsg" werden wie gewünscht ausgegeben, allerdings nicht "Hallo"
Code:
<html>
<body>
<script>
var db = openDatabase('neueDb', '1.0', "Test DB", 2 * 1024 * 1024);
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)');
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (1, "foobar")');
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (2, "logmsg")');
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (3, "hallo")');
});
db.transaction(function (tx) {
tx.executeSql('SELECT * FROM LOGS', [], function (tx, results) {
var len = results.rows.length, i;
for (i = 0; i < len; i++) {
alert(results.rows.item(i).log);
}
}, null);
});
</script>
</body>
</html>