I am trying to develop an app in phonegap that use Local Database.I create the database and table. But when I try to updating the content its not updating.Am getting the alert us "updating".
db = window.openDatabase("DirectoryDB", "1.0", "DB", 200000);
if (dbCreated){
db.transaction(updateShapes, transaction_error);
}
else{
db.transaction(populateDB, transaction_error, populateDB_success);
}
function populateDB(tx) {
var sqlShape = "CREATE TABLE IF NOT EXISTS shapeList ( "+"id INTEGER PRIMARY KEY AUTOINCREMENT, "+"shape_id INTEGER ," +"status VARCHAR(200),"+"purchase_stataus VARCHAR(200))";
tx.executeSql(sqlShape);
tx.executeSql("INSERT INTO shapeList (shape_id,status,purchase_stataus) VALUES (4,'paid','n')");
}
}
function populateDB_success()
{
dbCreated = true;
db.transaction(getImages, transaction_error);
}
function updateShapes(tx)
{
alert("updating");
var strResult = "4";
var status = "y";
tx.executeSql("UPDATE shapeList SET purchase_stataus='status' WHERE shape_id='+ strResult+'");
}
Can any please tell me the mistake of the code . Thanks in advance
Aucun commentaire:
Enregistrer un commentaire