Skip to content

Instantly share code, notes, and snippets.

@khajer
Created August 23, 2011 18:35
Show Gist options
  • Select an option

  • Save khajer/1166087 to your computer and use it in GitHub Desktop.

Select an option

Save khajer/1166087 to your computer and use it in GitHub Desktop.
titanium database connect
var db = Titanium.Database.open('imagazine');
//db.execute('drop database imagzine'); // for clear old
//db.execute('insert into books (book_id, issue_name, cover_image, book_name, download_completed) values(1,"101","issues/0/cover.jpg","car",1)');
var rows = db.execute('select * from books where download_completed = 1');
while (rows.isValidRow()){
/*
alert(rows.fieldByName('book_id'));
alert(rows.fieldByName('issue_name'));
alert(rows.fieldByName('cover_image'));
alert(rows.fieldByName('book_name'));
*/
}
rows.close();
db.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment