I just figured this out last week. Here is an example, assume a "contacts" table exists with a "first_name", a "last_name", and an "email" field...
1) Make a connection to your SQLite DB if you haven't already:
sqlConnection = new SQLConnection(); sqlConnection.open(File.applicationStorageDirectory.resolvePath("yourdbfile.db")); var sql:SQLStatement = new SQLStatement(); sql.sqlConnection = sqlConnection; getAccountInfo();
2) get the data and put it in an array:
var sql:SQLStatement = new SQLStatement(); sql.sqlConnection = sqlConnection; sql.text = "SELECT first_name, last_name, email FROM contacts WHERE id = 1 LIMIT 1;"; sql.execute(); var contactInfo:Array = sql.getResult().data;
3) Access the data directly or assign to variables:
var firstName:String = contactInfo.first_name; var lastName:String = contactInfo.last_name; var email:String = contactInfo.email;
Hope this helps...
Thanks for writing...I was able to get the answer from your response...
from the... getuserResult.token = ... I can gather the last name in the database via
users.LAST = getusersResult.lastResult.LAST
In a way, I misstated the question from the perspective that ColdFusion is doing all of the SQL.
That was my mistake actually, I was skimming instead of reading! Glad I could help still...