Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

looping in cffile..

Status
Not open for further replies.

psteja2000

Programmer
Feb 1, 2005
82
US
I wish to create a static html file using cffile. The input is going to be records that I obtained from a query. Basically I want to know how to loop while writing in to a file. Is there any way? how can I do this in the output attribute in the cffile???

Can someone please throw some light on this?

regards,
Teja
 
I'd create your string before i use cffile to create and write to the .html file you're going to create. that way you only have one disk I/O

Code:
<cfset myFile = "<html><body>Name: ">
<cfoutput query = "yourquery">
<cfset myfile = myFile & yourQuery.name & "<br>Address: " & yourQuery.Address & "<hr></body></html>">
</cfoutput>

<cffile action = "write" output = "#myFile#" file = "#yourPath#">

Beware of programmers who carry screwdrivers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top