I m trying to create a database in a mobile webapp, the only problem is Safari creates a new database every time I refresh the website. Here is my code:
var databaseOptions = {
fileName : "todo_database",
version : "1.0",
displayName : "todoDB",
maxSize : 1024
};
var database = openDatabase(databaseOptions.fileName, databaseOptions.version,
databaseOptions.displayName, databaseOptions.maxSize);
database.transaction(function(transaction) {
alert( table created );
transaction.executeSql("CREATE TABLE IF NOT EXISTS todos (" +
"id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," +
"todo TEXT NOT NULL,description TEXT,date DATE);");
});