I create an array:
var Detail:Array = new Array(getClass.detailArticle(brand, subgroup, name));
The method:
public function detailArticle(brand:String, subgroup:String, name:String):Array
{
var sqlConnection:SQLConnection;
sqlConnection = new SQLConnection();
sqlConnection.open(File.applicationStorageDirectory.resolvePath("assets/db.sqlite"));
var stmt:SQLStatement = new SQLStatement();
stmt.sqlConnection = sqlConnection;
stmt.text =
"SELECT * FROM sen_updatesnew " +
"WHERE Brand= '" + brand + "' " +
"AND SubGroup= '" + subgroup + "' " +
"AND Name = '" + name + "' ";
stmt.execute();
var result:Array = stmt.getResult().data;
return result;
}
How to access the elements?
Detail[“element”] or Detail[0] are not showing anything. The query is working by the way.
What am I doing wrong?
From the docs
Since you have a null responder argument for the execute method, you will have to listen for the results in the result event. It sounds like you’re trying to access the results before they are retrieved.