Ask a Question related to Coldfusion Database Access, Design and Development.
-
TheScarecrow #1
CFXML & CFFILE
I am trying to use CFXML to retrieve stuff from a database and then make an XML
file from the results and I am not sure if I am doing this write. Anyone done
this before or know if its possible. Thanks. Code is attached.
<CFFUNCTION NAME="displayDate">
<CFIF #event_date_end# GT "">
<CFreturn DateFormat(event_date, "mmmm") & " " & DateFormat(event_date,"d")
& " -" & DateFormat(event_date_end, "d") >
<CFelse>
<CFreturn DateFormat(event_date, "mmmm d")>
</CFIF>
</CFFUNCTION>
<cfquery name="getcalendar" datasource="calendarevents">
SELECT title, description, event_date, public, proj_key, category,
event_date_end, key
FROM event_cal
WHERE public=yes
ORDER BY event_date
</cfquery>
<cfxml variable="calendar">
<events>
<!---CFOUTPUT creates order of Data--->
Event
<CFOUTPUT query="getcalendar">
<CFIF #event_date# IS NOT "">
<CFSET endcalendar = DateAdd("d", 183, Now())>
<CFIF DateCompare(#event_date#, Now()) IS +1 AND DateCompare
(#event_date#, #endcalendar# ) is -1>
#displayDate()# #title#
</CFIF>
</CFIF>
</CFOUTPUT>
</events>
</cfxml>
<cfdump var=#calendar#>
<!---Create XML File--->
<cffile
action="write"
destination="\\webserver\calendar"
file="C:\Documents and Settings\users\Desktop\rss.xml"
output="test.cfm"
</cffile>
TheScarecrow Guest
-
CFXML and Flash
Hi folks, I am trying to connect my database with Flash via Coldfusion 7. Is it possible for CF to create the XML using CFXML and then pass this... -
cffile
Hi, How do u code for break line when you have the output for cffile? <cffile action="append"... -
USING CFFILE
I am appending data from query to text file.The number of records appended approximately are about 35000 records.I wrote the code in the format... -
need help with cffile
I am having some trouble with cffile - i am trying to uplaoad a few files in a form and rename them to be inserted into the database - the problem... -
Need Help With CFFILE Please
Good morning. I was able to output my query to a text file without any problems. Now I have to adjust the results by formatting it to specific... -
Sojovi #2
Re: CFXML & CFFILE
Is wrong :
<cffile
action="write"
destination="\\webserver\calendar"
file="C:\Documents and Settings\users\Desktop\rss.xml"
output="test.cfm"
</cffile>
You should have something like :
<cffile action="write" file="C:\target_folder\target_file_name"
output="#Var with the content to write to the file#">
Regards
Sojovi Guest
-
Abinidi #3
Re: CFXML & CFFILE
You also have the word " Event" here right after your comment that has no
relevance on anything:
<cfxml variable="calendar">
<events>
<!---CFOUTPUT creates order of Data--->
Event
<CFOUTPUT query="getcalendar">
Also you are saving it as a .cfm page, which is not recommended. You should be
saving it as an .xml file:
output="test.cfm"
If you need to save it as a .cfm, use CFCONTENT to generate it.
Abinidi Guest



Reply With Quote

