Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trycf/77846e5ac4800202aafc8d199065ce55 to your computer and use it in GitHub Desktop.
Save trycf/77846e5ac4800202aafc8d199065ce55 to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
data = [];
appendItem = [:];
q = queryNew("id,title");
for (i=1; i < 5; i++){
QuerySetRow(q,0,{id:i,title: "title #i#"});
}
dump(q);
dump(q.currentrow);
for ( item in q ) {
dump(item);
appendItem[ 'id' ] = item.id;
appendItem[ 'title' ] = item.title;
data.append( duplicate(appendItem) );
}
dump(q.currentrow);
writeOutput( serializeJSON( data ) );
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment