Created
December 1, 2008 03:38
-
-
Save jhaynie/30609 to your computer and use it in GitHub Desktop.
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
<div id="result">You should have seen a count here</div> | |
<script> | |
ti.ready(function($) | |
{ | |
var db = new ti.Database | |
db.open("foo"); | |
db.execute("create table if not exists Test (Phrase text, Timestamp int)"); | |
db.execute("insert into Test values (?,?)", ["Jeff!",new Date().getTime()]); | |
var rs = db.execute("select count(*) from Test where Phrase like 'Jeff%'"); | |
if (rs.isValidRow()) | |
{ | |
$("#result").html("number of records: "+rs.field(0)); | |
} | |
rs.close(); | |
}); | |
</script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment