| Discussion Home | About | Threads By Date | Search |
Title
AIR Database Connection Express (JS AND HTML )
Content
Database Connectivity for ADOBE AIR ( JS HTML )
STEP 1 - include the db.js script
db.js is included in the db.zip at the bottom of this post.
=============
<script type="text/javascript" src="db.js"></script>
STEP 2 - usage
================
<script type="text/javascript">
// connect to the database
// one.sqlite is my db name
dbo.init('one.sqlite');
// execute SQL commands
// table name = groups
dbo.execute("SELECT * FROM groups");
// return the data
var rows = dbo.fillData();
// working with the data
for(var i = 0; i < rows.length; i++) {
var row = rows[i];
// row.columnName
// name is the name of the column I'm getting data from
alert(row.name);
}
</script>