Created
August 19, 2011 16:27
-
-
Save winterlightning/1157259 to your computer and use it in GitHub Desktop.
Simple db calls to mimic localstorage. Fix for titanium bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db_path = Titanium.Filesystem.getFile(Titanium.Filesystem.getApplicationDataDirectory(), 'gtasktic.db'); | |
db = Titanium.Database.openFile( db_path ); | |
db.execute("CREATE TABLE IF NOT EXISTS keyval ( key TEXT, value TEXT )"); | |
//Insert | |
db.execute("INSERT INTO keyval (key, value) VALUES ('" +this.name +"', '"+ result +"')"); | |
//Read | |
var resultSet = db.execute("SELECT value FROM keyval WHERE key = '"+ this.name +"' LIMIT 1"); | |
result = resultSet.field(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment