Skip to content

Instantly share code, notes, and snippets.

@CFJSGeek

CFJSGeek/queryToArray.cfc

Last active Sep 10, 2015
Embed
What would you like to do?
ColdFusion 10+ Query to Array of Stucts
// convert a query to an array of structs
// credit: http://www.bennadel.com/blog/2367-coldfusion-10---looping-over-queries-using-a-for-in-loop-in-cfscript.htm
function queryToArray( required query query ){
var queryAsArray = [];
for (var row in query){
arrayAppend( queryAsArray, row );
}
return(queryAsArray);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.