Debt Consolidation - Debt Consolidation - Debt Consolidation - Synchronize your Files - Find jobs

PDA

View Full Version : How to read from 2 queries


youjie
Nov 6th 2006, 6:51 pm
May i know how to read from 2 queries?

For example, I have use

<cfoutput query="FindCountry">
<cfoutput query="FindNationality">
The country is #FindCountry.id#
The nationality is #FindNationality.id#
</cfoutput>
</cfoutput>

I was prompted an error when i do this.

Thanks

datropics
Nov 6th 2006, 11:17 pm
Get rid of the second <cfoutput>. Why because you are already 'outputting'. You only now need to loop. Hence your code should instead be:
<cfoutput query="FindCountry">
<cfloop query="FindNationality">
The country is #FindCountry.id# and
The nationality is #FindNationality.id# <br />
</cfloop>
</cfoutput>

Hope I helped

DaTropics!

websiteideas
Nov 23rd 2006, 7:49 pm
What if you wanted to loop through both of the queries?

datropics
Nov 24th 2006, 12:18 am
with the code above, you already are. What are you trying to do?