jturkington
asked on
CFLOOP Query & CFOUTPUT Query
When should you use CFLOOP Query and CFOUTPUT Query ??
Cheers
JT
Cheers
JT
This discussion might also help:
http://www.houseoffusion.com/cf_lists/messages.cfm/threadid:38486/forumid:4
http://www.houseoffusion.com/cf_lists/messages.cfm/threadid:38486/forumid:4
ASKER
Define a huge page ?
I use cfoutputs around each variable needed ?!?
Say for a page that has about 30 variables in it ?
Should i use just the one cfoutput ??
I use cfoutputs around each variable needed ?!?
Say for a page that has about 30 variables in it ?
Should i use just the one cfoutput ??
I would say that best practice - you should be using as few cfoutputs as possible.
If you are simply printing out a variable, and doing that 5 times in a row with some HTML in between, use one cfoutput around it all.
If you have to output a query, use cfloop unless you need to do some funky grouping on it. This means you dont have to put cfoutput tags all over the place.
If you are simply printing out a variable, and doing that 5 times in a row with some HTML in between, use one cfoutput around it all.
If you have to output a query, use cfloop unless you need to do some funky grouping on it. This means you dont have to put cfoutput tags all over the place.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In CFMX6 and up there is practically no difference in performance.
Alot of people like to put a cfoutput around the entire page and then do cfloops over the queries so you dont jump in and out of outputs. This keeps the page tidier, and if its a hug page, with lots of moving between cfoutput then I expect it will slow it down.
with cfloop you cant group by a value in the query, like you can with cfoutput.