Hi ,
I am trying to learn cfc's and I have problem that I can't figure out. Basically I have one function that returns a query.
And for practise I want to display the result of the first function in the second function.
The problem I have is how do I define the result from the first function in the second function.
Any suggestions would be much appreciated.
I am trying to learn cfc's and I have problem that I can't figure out. Basically I have one function that returns a query.
And for practise I want to display the result of the first function in the second function.
The problem I have is how do I define the result from the first function in the second function.
Any suggestions would be much appreciated.
Code:
<cffunction name="ListCat" hint="Get query for business categories" >
<!--- Optional argument--->
<cfargument name="CatID" required="No" default="" >
<!--- Run Query --->
<cfquery name="GetBusinessCat" datasource="#request.SiteDSN#">
SELECT BusinessCatID, BusinessCatName
FROM holanet.holanet_businesscat
<!--- If argument is defined --->
<cfif ARGUMENTS.CatID NEQ "">
WHERE BusinessCatID = #ARGUMENTS.CatID#
</cfif>
ORDER BY holanet_businesscat.BusinessCatName
</cfquery>
<!--- Return Result --->
<cfreturn GetBusinessCat>
</cffunction>
<cffunction name="ListCatAgain" >
<cfset NewList = GetBusinessCat.BusinessCatName >
<cfreturn NewList>
</cffunction>