Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9259405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:39:02+00:00 2026-06-18T12:39:02+00:00

I’m looking to loop through a query, and would like to use grouping, like

  • 0

I’m looking to loop through a query, and would like to use grouping, like one would using cfoutput. I know CF10 added that support, but is there a script that emulates that behaviour so that items can be iterated easily?


Edit:
There are ways of getting around the lack of grouping in cfloop, by rearranging cfoutput tags, so they are not nested. The reason I’m looking for the cfloop workaround is that when nesting cfoutput, you need to use the results from the same query. I’d like to use my own QoQ and loop through the result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:39:03+00:00Added an answer on June 18, 2026 at 12:39 pm

    OK, so you want to do this sort of thing:

    <cfoutput query="query1">
        <!--- stuff --->
        <cfoutput query="query2" group="col>
            <!--- more stuff --->
            <cfoutput>
                <!--- still more stuff --->
            </cfoutput>
            <!--- almost the last stuff --->
        </cfoutput>
        <!--- last stuff --->
    </cfoutput>
    

    ?

    And the second loop gives you an error:

    Invalid tag nesting configuration.
    
    A query driven cfoutput tag is nested inside a cfoutput tag that also has a query attribute. This is not allowed. Nesting these tags implies that you want to use grouped processing. However, only the top-level tag can specify the query that drives the processing.
    

    You should be able to revise that to:

    <cfloop query="query1">
        <cfoutput>
            <!--- stuff --->
        </cfoutput>
        <cfoutput query="query2" group="col>
            <!--- more stuff --->
            <cfoutput>
                <!--- still more stuff --->
            </cfoutput>
            <!--- almost the last stuff --->
        </cfoutput>
        <cfoutput>
            <!--- last stuff --->
        </cfoutput>
    </cfloop>
    

    There’s another option to emulate the group loop if you must. But that’s a bunch of thinking and typing I’d rather avoid if poss, so let me know if this approach works first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to run a str_replace or preg_replace which looks for certain words
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am confused How to use looping for Json response Array in another Array.
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.