You need to nest <cfoutput>s.
Something like this will work for you:
<cfoutput query="getmylistings" group="PropertyID">
<cfif PropertyPhoto NEQ ""><img
src="images/rentals/#PropertyPhoto#"></cfif>
<b>#PropertyName#</b><br>
#PropertyDescription#<br>
<cfset TempVariable = #PropertyID#><br>
<b>Rates</b><br>
<cfoutput>
<b>#TempVariable#</b> - #RatesSeason#
#DollarFormat(RatesPrice)#<br>
<br>
</cfoutput>
</cfoutput>
----- Original Message -----
From: "Jeff Small" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, February 12, 2003 12:41 PM
Subject: Why isn't my output showing up right?
> There are so many people yelling at me right now...I'm about to commit
hari
> kari...please help me...
>
> Okay, My query works. I know this because I can "test" it by clicking on
my
> recordset and clicking "test" and passing the appropriate variable.
>
> My Joins are working, this much I know.
>
> What I'm trying to do, is output the rates for each property. There are
> multiple rates for each property. My thinking was to loop, using the query
> to initialize my loop, and simply check for a match, then output that
Row's
> corresponding rates.
>
> However this isn't working, whenever I put the loop in the output, it only
> returns one record. When I take OUT the loop, it returns all the records
but
> only one rate:
>
> Here's my query (like I said, tested, and it's returning the right stuff):
> <cfquery name="getMyListings" datasource="MYDSN">
> SELECT RentalProperties.PropertyID, RentalProperties.PropertyName,
> RentalProperties.PropertyPhoto, RentalProperties.PropertyType,
> RentalProperties.PropertyAddress, RentalProperties.PropertyDescription,
> RentalProperties.PropertyBedrooms, RentalRates.RatesID,
> RentalRates.RatesPrice,
> RentalRates.RatesSeason, RentalRates.RatesProperty
> FROM (RentalLocations INNER JOIN RentalProperties ON
> RentalLocations.LocationID=RentalProperties.PropertyLocation) INNER JOIN
> RentalRates
> ON RentalProperties.PropertyID=RentalRates.RatesProperty
> WHERE RentalProperties.PropertyLocation = #URL.Location#
> ORDER BY RentalProperties.PropertyID
> </cfquery>
>
> And here's version one of the output:
> <cfoutput query="getmylistings" group="PropertyID">
> <cfif PropertyPhoto NEQ ""><img
src="images/rentals/#PropertyPhoto#"></cfif>
> <b>#PropertyName#</b><br>
> #PropertyDescription#<br>
> <cfset TempVariable = #PropertyID#><br>
> <b>Rates</b><br>
>
> <b>#TempVariable#</b> - #RatesSeason# #DollarFormat(RatesPrice)#<br>
> <br>
> </cfoutput>
>
> Which works fine, but only returns (as expected) ONE rate, when in fact
> there are multiple rates.
>
> So I added a cfloop, like so:
> <cfoutput query="getmylistings" group="PropertyID">
> <cfif PropertyPhoto NEQ ""><img
> src="images/rentals/#PropertyPhoto#"></cfif>
> <b>#PropertyName#</b><br>
> #PropertyDescription#<br>
> <cfset TempVariable = #PropertyID#><br>
> <b>Rates</b><br>
> <cfloop query="getmylistings">
> <cfif TempVariable EQ RatesProperty>
> <b>#TempVariable#</b> - #RatesSeason#
> #DollarFormat(RatesPrice)#</cfif><br>
> <br>
> </cfloop>
> </cfoutput>
>
> And now I only return one record.
>
> What gives? I know it's something so simple, that I'm going to bang my
head
> when I see it.
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4