Surfin’ Safari – Blog Archive » WebKit Does HTML5 Client-side Database Storage.
Here is a quick and easy function to get you started with SQLite on Webkit. This is designd for quick INSERT, DELETE, UPDATE statements. It’s simple and to the point. Just pass in an sql variable and that code will be executed…
Not much more to it. This is a great way to start fiddling around with SQLite.
1 2 3 4 5 6 7 8 9 10 | function sqlLite(sql) { myDB.transaction( function (transaction) { transaction.executeSql(sql); ); } // Quick usage example: sql = “INSERT INTO mytable (name) VALUES(’Bob’)”; sqlLite(sql); |
If you’re from a PHP background think of it as a mysql_query() function. You can also add call backs if you wish but I won’t go into that unless someone really want me to.
Comments
Powered by Facebook Comments