Skip to content

Instantly share code, notes, and snippets.

@ZhangHanDong
Created January 13, 2009 09:19
Show Gist options
  • Save ZhangHanDong/46380 to your computer and use it in GitHub Desktop.
Save ZhangHanDong/46380 to your computer and use it in GitHub Desktop.
<script type="text/javascript" src="gears_init.js"></script>
<script type="text/javascript">
var db = google.gears.factory.create('beta.database');
db.open('database-test');
db.execute('create table if not exists Test' +
' (Phrase text, Timestamp int)');
db.execute('insert into Test values (?, ?)', ['Monkey!', new Date().getTime()]);
var rs = db.execute('select * from Test order by Timestamp desc');
while (rs.isValidRow()) {
alert(rs.field(0) + '@' + rs.field(1));
rs.next();
}
rs.close();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment