Hi, I am trying to make a cfc with more than one cfquery, so that I can use 
this to display the results in more than one page.

Am I doing something really wrong here?

<cfcomponent>

    <cffunction name="getLinks1" access="public" returntype="query"> 
        <!--- cfquery for CF--->
        <cfquery name="CFLinks" datasource="#REQUEST.dataSource#">
            SELECT *
            FROM Links
            WHERE category = "CF"
            ORDER BY title ASC 
        </cfquery>
        
        <cfreturn CFLinks> 
    </cffunction> 

    <cffunction name="getLinks2" access="public" returntype="query"> 
        <!--- cfquery for CF--->
        <cfquery name="FLashLinks" datasource="#REQUEST.dataSource#">
            SELECT *
            FROM Links
            WHERE category = "flash"
            ORDER BY title ASC 
        </cfquery>
        
        <cfreturn FLashLinks> 
    </cffunction>

</cfcomponent>


<!--- myTestPage.cfm---> 
<cfinvoke component="Testing" 
method="CFLinks" 
returnvariable="CFLinks"/> 

<cfoutput query="CFlinks"> <a href="#getLinks1.link#">#getLinks1.title#</a> <br 
/> #description#<p></cfoutput>
<p>

<cfinvoke component="Testing" 
method="FlashLinks" 
returnvariable="FlashLinks"/> 

<cfoutput query="Flashlinks"> <a href="#getLinks2.link#">#getLinks2.title#</a> 
<br /> #description#<p></cfoutput> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4728
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