>
> Thanks for the response. How are situations handled where you have a
> query within a loop handled within Fusebox?
>
> For example:
>
> <CFLOOP INDEX="CountLoop" FROM=1 TO=10>
> <CFQUERY .....>
> SELECT * FROM Table
> WHERE ID = CountLoop
> </CFQUERY>
>
> <CFOUTPUT>
> You are at record #ID#.
> </CFOUTPUT>
> </CFLOOP>
>
> I don't see an easy way to abstract this functionality back to only
> CFINCLUDEs at the index.cfm.
>
Kevin,
I'm not sure why you would do this anyway..... The code above would be 10
hits on the database - you would be far better doing.....
<CFQUERY name="MyQuery" datasource="MyDSN">
SELECT * FROM Table
WHERE ID < 10
</CFQUERY>
<cfoutput query="MyQuery">
#ID# - #currentrow#
</cfoutput>
Also, your code example from your first email...
> <CFIF Attributes.UserName IS "Dave">
> <CFINCLUDE TEMPLATE="qry_Dave">
> <CFELSE>
> <CFINCLUDE TEMPLATE="qry_NotDave">
> </CFIF>
Would it not be better to do away with this and write a file called
qry_user.cfm (or whatever) which contains a query like this:
select * from table
where username = '#attributes.UserName#'
Its not good practice to hard code a query for a variable piece of data as
you have in the above <cfif> statement.
Fusebox applications look more like this in your index.cfm:
<cfinclude template="app_locals.cfm">
<cfswitch expression=#attributes.fuseaction#>
<cfcase value="GetUser">
<Cfinclude template="qry_user.cfm">
<cfinclude template="dsp_user.cfm">
</cfcase>
<cfdefaultcase>
<Cfinclude template="qry_getuserdetail.cfm">
<cfinclude template="dsp_userlist.cfm">
</cfdefaultcase>
</cfswitch>
Is this bring you any closer to understanding Kevin?
Hope I've helped.
Regards
Stephen
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.