Sorry You needed Count of Lectures...

-------------------------
<cfquery name=getCategory datasource=xxxx>
        Select category_id,category_name from tbl_category
</cfquery>

<table width=100% cellspacing=0 cellpadding=0  border=1>
<cfloop query=getCategory>
        <cfquery name=getLecture datasource=xxxx>
                Select count(lecture_id) as lectures_count from
tbl_lecture where category_id=#getCategory.category_id#
        </cfquery>
<tr><td><cfoutput>#getcategory.category_name#</cfoutput></td><td><cfoutp
ut>#getLecture.lectures_count#</cfoutput></td></tr>
</cfloop>
</table>
-------------------------

Thanks,

-Sandy Vohra


-----Original Message-----
From: Vohra, Sandeep Singh 
Sent: Monday, December 11, 2006 4:51 PM
To: '[email protected]'
Subject: RE: Unwanted Loop in Dynamic Table

Please try this and let me know if this helps..

----------------------------------
<cfquery name=getCategory datasource=xxxx>
        Select category_id,category_name from tbl_category
</cfquery>

<table width=100% cellspacing=0 cellpadding=0  border=1>
<cfloop query=getCategory>
        <cfquery name=getLecture datasource=xxxx>
                Select lecture_id,lecture_name from tbl_lecture where
category_id=#getCategory.category_id#
        </cfquery>
<tr><td><cfoutput>#getcategory.category_name#</cfoutput></td><td><cfoutp
ut>#ValueList(getLecture.lecture_name)#</cfoutput></td></tr>
</cfloop>
</table>

----------------------------------

Thanks.

-Sandy Vohra


-----Original Message-----
From: Gary Strommen [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 11, 2006 2:59 PM
To: CF-Newbie
Subject: Re: Unwanted Loop in Dynamic Table

Thank you Randi...
    I looked at your idea but I still am s not getting the results I am
looking for.  I will keep playing with it.

Thank you Vohra, Sandeep Singh...
     If <cfoutput query="qGetLectureCategories" > itself is a loop...

     May I use CFBREAK or something similar to prevent it from looping?

Thanks again!



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2338
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to