• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

4. Database Basics > 4.7. Looping Over a Query Result Set

Looping Over a Query Result Set

As I mentioned briefly in Chapter 2, a query loop (cfloop tag with the query attribute) performs essentially the same job as using a cfoutput tag with the query attribute. A query loop iterates over each row in a query object. Optionally, a start row and end row within the query may be specified:

<cfloop query="query_name"
        startrow="row_number"
        endrow="row_number">
...
</cfloop>

The query attribute specifies the name of a valid ColdFusion query object. startrow is optional and may be used to specify the row within the query object where the loop should begin. endrow is also optional and specifies the last row within a query object that should be included within the loop.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint