I'm outputting the results of a query to file.txt in JSON. The file is updated every time I click on 'submit'(form) and depending on the variables it updates the query.
Right now the table only has about 20 records and will probably increase by 2/3 new records everyday.
Is there a better way to updating the file test.txt getting the results from a query?
index.cfm:
<cfsavecontent variable="mytest">
[
<cfoutput query="getimeline">
<cfif (getimeline.CurrentRow EQ getimeline.RecordCount)>
{"title":"#name_time#","date":"#dateformat(date_time,"mmmm d, yyyy")#"}
<cfelse>
{"title":"#name_time#","date":"#dateformat(date_time,"mmmm d, yyyy")#"},
</cfif>
</cfoutput>
]
</cfsavecontent>
<cffile action="write" file="C:test.txt" output="#mytest#">
test.txt:
[
{"title":"Advance pay Rollovers","date":"October 23, 2015"},
{"title":"New Card Ordering Process 1","date":"December 28, 2015"},
{"title":"about about","date":"February 5, 2016"}
]