hi Bryan, have you read Apple's documentation on subject? http://developer.apple.com/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/UsingtheJavascriptDatabase/chapter_4_section_1.html#//apple_ref/doc/uid/TP40007256-CH3-SW1 There could be many things to check: is your DB created at all? (as reference in javascript and in disk). Was your error handler fired? Apple's docs contains example code implementation. I've used webkit example when learning Safari local storage: http://webkit.org/misc/DatabaseExample.html
regards, Peter On Jan 24, 9:06 am, Bryan A <[email protected]> wrote: > I am trying to figure out how to use the Safari JS database. The only > thing that I have been able to do successfully is to create the db, > the rest doesn't seem to be saving. All I really want to do is save > one entry and then be able to read and update it. Here is what I have > tried: > > var mydb = openDatabase("testDB", "1.0", "test"); > > function nullDataHandler(transaction, results) { } > function createTables(db) > > { > > db.transaction( > > function (transaction) { > /* The first query causes the transaction to > (intentionally) fail if the table exists. */ > transaction.executeSql('CREATE TABLE people(id INTEGER NOT > NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL DEFAULT "John Doe", > shirt TEXT NOT NULL DEFAULT "Purple");', [], nullDataHandler, > errorHandler); > > transaction.executeSql('insert into people (name, shirt) > VALUES ("Joe", "Green");', [], nullDataHandler, errorHandler); > > transaction.executeSql('insert into people (name, shirt) > VALUES ("Mark", "Blue");', [], nullDataHandler, errorHandler); > > transaction.executeSql('insert into people (name, shirt) > VALUES ("Phil", "Orange");', [], nullDataHandler, errorHandler); > > transaction.executeSql('insert into people (name, shirt) > VALUES ("stupid", "Purple");', [], nullDataHandler, errorHandler); > } > > ); > > } > > Any help is much appreciated > > Thanks, > Bryan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en -~----------~----~----~----~------~----~------~--~---
