I've created a history.db and sampled a script from the Kitchen Sink to read it which works.
But I'm having trouble inserting a new row. the code below does'nt seem to be working:
var urlvalue = "http://someurl.com"; var db = Titanium.Database.open('history.db','urlHistory'); db.execute('CREATE TABLE IF NOT EXISTS urlHistory (urlID INTEGER, url TEXT, dtime DATETIME DEFAULT CURRENT_TIMESTAMP)'); db.execute('INSERT INTO urlHistory (url) VALUES(?)' ,urlvalue);
I read that I didn't need a urlID as it will autoincrement and the current timestamp will update also, therefore just need to insert the URL of that the user passes through my form.
DATE/DATETIME badly supported at the moment
And be really careful about the data type used when you create your table.