我已成功将表添加到 sql lite 数据库,但我正在努力将值写入表的语法,请查看下面的代码并就正确的语法向我提供建议。
对不起代码!
var db = window.openDatabase("Database", "1.0", "GBA", 200000);
db.transaction(populateDB, errorCB, successCB);
}
// Populate the database
//
function populateDB(tx) {
tx.executeSql('DROP TABLE IF EXISTS vehiclecheck');
tx.executeSql('CREATE TABLE IF NOT EXISTS vehiclecheck (id INTEGER PRIMARY KEY AUTOINCREMENT, checkfield VARCHAR(12), class INTEGER)');
tx.executeSql('INSERT INTO vehiclecheck (checkfield, class) VALUES (' + 'Test' + ',' + 1 + ')');