Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
brokerandy25 #1
cfloop error
I am getting an error that is resolving to the closing tag for the </cfloop>.
Any Ideas?
<cfoutput query="Recordset1" group="category">
<table cellpadding="2" cellspacing="0" border="1">
<tr>
<cfloop query="PictureURL">
<cfif NOT CurrentRow Mod 2>
<td><img src="#PictureURL#"
alt="undefined.#PictureURL#"><br>#caption#</td></tr>
<cfif CurrentRow NEQ RecordCount><tr></cfif>
<cfelse>
<td><img src="#PictureURL#" alt="undefined.#PictureURL#"><br>#caption#</td>
<cfif CurrentRow EQ RecordCount>
<cfif CurrentRow Mod 1>
<td> </td><td> </td>
<cfelse>
<td> </td>
</cfif>
</tr>
</cfif>
</cfif>
</cfloop>
</table>
</cfoutput>
brokerandy25 Guest
-
cfloop
The goal is to insert a record into table 'atd', which contains a document id and an associate id, for each document (38) and associate (150). So... -
Attribute validation error for tag cfloop
I am trying to dynamically generate a "photo album" output into a table with corresponding captions: The out put should be 1 2 1.c 2.c... -
Cfloop..
I am trying to loop over a list: <cfquery name="updsyllabus" datasource="#arguments.syl.dsn#"> UPDATE #arguments.syl.tname# SET <cfloop... -
CFLOOP out of memory error
I am looping through a huge query, upto 800K records to do a bunch of calculations. Basically, comparing dates, adding dates, and counting... -
CFLOOP Error?
I keep getting an error that says that I need to have a CFLOOP end tag? The bolded line is where Coldfusion says the error is occurring: <cfquery... -
brokerandy25 #2
Re: cfloop error
oops old code . . . . the 4th line is correct it does read <cfloop query="Recordset1>
brokerandy25 Guest
-
-
brokerandy25 #4
Re: cfloop error
THe CF server is telling me that there is a "Attribute validation error for tag
cfloop at line 166". line 166 resolves to </cfloop> and that is all that is on
that line.
I am way confused.
THanks for the help
andy
[url]http://www.indianaevenings.com[/url]
brokerandy25 Guest
-
dempster #5
Re: cfloop error
I think the error is actually in your initial CFLOOP tag. Why are you using
CFOUTPUT on your query, then using CFLOOP on the same query? If you want to
group by category in your initial CFOUTPUT tag, you use CFOUTPUT by itself to
then loop through each record inside the group.
At any rate, I think the error is caused by a conflict using CFOUTPUT and
CFLOOP on the same query.
-Paul
dempster Guest
-
brokerandy25 #6
Re: cfloop error
Still confused - maybe I am trying to go about this all wrong, I am trying to
pull info from a data base (duh) and I need to output the info like this
1 2
1.c 2.c
3 4
3.c 4.c ETC. . ..
1, 2, 3, 4, are photos, which img src tag is dynamically generated from an
address that is stored in a database
and the 1.c, 2.c are captions that correspond to those images. I need to
output them in rows, with only 2 pictures per row, but I will not know how many
pictures there are.
If I try messing with the cfloop or cfoutput, then the pictures don't show in
Opera 7, and nothing will show in IE which is what this code needs to be
compatibal with. THIS problem, has seriously caused a major headache.
I thank you for your time.
Andy
brokerandy25 Guest
-
dempster #7
Re: cfloop error
So where does the group by category come from? Are you creating a different
table for each category?
If so, you can group your output by category and then use CFOUPUT to get each
image. You can't test for current row as odd or even because this will change
for each category. Just use a simple variable to keep track of which column you
are in and keep switching it for each record. The attached code should
demonstrate.
-Paul
<cfoutput query="Recordset1" group="category">
<h2>#category#</h2>
<table cellpadding="2" cellspacing="0" border="1">
<cfset col = 1><tr>
<cfoutput>
<td><img src="#PictureURL#" alt="#caption#"><br>#caption#</td>
<cfif col IS 2></tr><cfset col = 1><cfelse><cfset col = 2></cfif>
</cfoutput>
<cfif col IS 2><td> </td></tr></cfif>
</table>
</cfoutput>
dempster Guest



Reply With Quote

