I try to create a database and then inserting the data. End up I keep getting this error processing sql:5. I cant found where the error located. Please help...
document.addEventListener("deviceready", onDeviceReady, false);
function populateDB(tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS tblEve (id INTEGER PRIMARY KEY AUTOINCREMENT, EventName,Location,Date1,StartTime,EventOrga)');
}
function errorCB(err) {
alert("Error processing SQL: "+err.code);
}
function successCB() {
var db = window.openDatabase("EventDB", "1.0", "Event List", 200000);
db.transaction(errorCB);
}
function onDeviceReady() {
var db = window.openDatabase("EventDB", "1.0", "Event List", 200000);
db.transaction(populateDB, errorCB, successCB);
}
function insertDB(tx) {
tx.executeSql('INSERT INTO tblEve (EventName,Location,Date1,StartTime,EventOrga) VALUES ("' +document.getElementById("txtEname").value
+'","'+document.getElementById("txtLocation").value
+'","'+document.getElementById("txtDate1").value
+'","'+document.getElementById("txtStime").value
+'","'+document.getElementById("txtEorga").value
+'")');
}
function submit1() {
var db = window.openDatabase("EventDB", "1.0", "Event List", 200000);
db.transaction(errorCB, successCB);
}
Aucun commentaire:
Enregistrer un commentaire