runrunforest
unread,Sep 14, 2010, 1:04:54 PM9/14/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium Apps
I create a table in which id has properties, integer, primary key and
ASC, with that, when we insert new record, the id value is supposed
to
auto generate, Just like MySQL.
But It aint. below is my SQL. And my first row shows id/empty
content/"my first note". Did I set the database attr/property for id
column incorrectly or web database work differently from others
databases ?
// open database
if (window.openDatabase) {
db = openDatabase("my notes", "1.0",
"my notes on local database", 3000000000);
}
// create table
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS
notes (id INTEGER PRIMARY
KEY ASC, content TEXT, timestamp INTEGER)');
});
// insert data
var content="my first note";
db.transaction(function (tx)
{
tx.executeSql("INSERT INTO notes (content)
VALUES (?)", [content]);
});