Created
August 10, 2021 15:17
-
-
Save trycf/77846e5ac4800202aafc8d199065ce55 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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