Database Question/Help
-
Hi everyone can you help me out??
@function loadDatabase()
{
if (db)
return;db = openDatabaseSync("Sipnayan", "1.0", "Sipnayan", 1000000); if (!db) return; var rs; db.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS levels(level INT, date DATETIME)'); rs = tx.executeSql('SELECT * FROM levels ORDER BY level DESC LIMIT 1'); }); if (rs.rows.length > 0) { var record = rs.rows.item(0); scene.level= record.level; }
}
// Update score database
function saveLevelToDisk()
{
if (!db) {
console.log("Warning: Database is not open");
return;
}db.transaction(function(tx) { tx.executeSql("INSERT INTO levels VALUES(?, date('now'))", [scene.level]); });
}@
**im having a problem here when i compile and run my app.. there's an error on this line
@db.transaction(function(tx) {
tx.executeSql("INSERT INTO levels VALUES(?, date('now'))", [scene.level]);
});@error: db.transaction is not a function
how can i solve this??and i wanna ask.. i want to insert 4 values? how will i do that?? is it like this?
@tx.executeSql("INSERT INTO levels VALUES(?,?,?, date('now'))", [scene.username,select.area,option.stage]);@
and how will I be able to call these records in let say i was able to add them in a table.. how would i call the values in the database to a specific qml??
-
Hi everyone, can someone please teach about offline storage?? im having a big problem here
please refer to this thread
http://developer.qt.nokia.com/forums/viewthread/10311/
thanks guys