Ask a Question related to Coldfusion Database Access, Design and Development.
-
raulriera #1
cfoutput and cfloop
Hi all, well this is my question:
I want to show 2 or more different sets of record sets but one or more of them
have to be nested on the first, since I cant do
<cfoutput query="query1">
<cfoutput query="query2"> </cfoutput>
</cfoutput>
I tried replacing the second cfoutput with cfloop
<cfoutput query="query1">
<cfloop query="query2"> </cfloop>
</cfoutput>
Now this works fine for outputting the data in the second query but for some
reason the data in the first nested inside the second query wont update
(example)
<cfoutput query="query1">
<cfoutput query="query2">
#query1.id# #query2.name#
</cfoutput>
</cfoutput>
I will always get the first query id in that output and not the "current"
one.. why is this happening?? hope I made myself clear hehe seems like a lot of
examples
raulriera Guest
-
Cfoutput help!!!
I am trying to figure out how to output records from a query that is returing 2 distinct table rows from each query. THe out put needs to look like... -
cfoutput and css
I declare an entire document within a <cfoutput> </cfoutput> section. I am trying to insert the following css style descriptor into the code: ... -
Listbox, CFOUTPUT, and CFLOOP
I'm trying to create a form to update a record. This record is already saved in the DB of course, so all the fields already have values. I'm able to... -
concat cfloop index to cfoutput variable inside loop?
Hi, STUPID question here: I have a cfloop, index j. I have a text field, DESCRIPTION_#j#, inside the loop. I want to populate the VALUE of the... -
<cfoutput>
Hi. I'm trying to rename a file but I get an error message. My code looks someting like this: <cfset source='C:\MyDocs\old.doc'> <cfset... -
The ScareCrow #2
Re: cfoutput and cfloop
When looping through 2 queries, the outer query seems to be lost (for the
values of that row)
<cfoutput query="query1">
<cfset query1ID = query1.id>
<cfloop query="query2">
#query1ID# #query2.name#
</cfloop>
</cfoutput>
This should do it.
Ken
The ScareCrow Guest
-
vkunirs #3
Re: cfoutput and cfloop
Hi
I think it is having some problem(bug).
even i faced similar problem.
See this code :
<cfquery name="parttype" datasource="party">
select * from parttype
</cfquery>
<cfoutput query="parttype">
<cfquery name="parts" datasource="party">
select * from parts where partTypeID=#parttype.partTypeID#
</cfquery>
<cfloop query="parts">
#parttype.parttype# #name#
</cfloop>
#parttype.partTypeID#,#parttype#<br>
</cfoutput>
in the cfloop when i display #parttype.parttype# i am getting it as 1 only.
means the first id.
but after the cfloop i will get the correct #parttype.parttype# value.
vkunirs Guest
-
vkunirs #4
Re: cfoutput and cfloop
Hi Ken
that way we can do easily but we need store that field value into another varaible and we need to use that variable in the loop
that is i am doing till now.
k any how many thanks.
vkunirs Guest
-
raulriera #5
Re: cfoutput and cfloop
Thank you all guys, I guess it is a bug since its something so simple :S storing the data in a variable worked fine.
Thanks again
raulriera Guest



Reply With Quote

