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 7708199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:33:01+00:00 2026-06-01T00:33:01+00:00

I am creating a dynamic recordset where I populate a couple values to the

  • 0

I am creating a dynamic recordset where I populate a couple values to the query used to select all inked records.

Next I need loop and group the results but am unsure how to group by the values used in the query.

Reference query:

SELECT fldItem, fldDescription, fldRank,fldType FROM tableName
WHERE fldType IN (33, 34, 36) ORDER BY fldRank

The values 33,34 and 36 are going to be passed dynamically to the query.
My goal is to then have a loop/repeat region that allows display in groups with all the results that share the same fldType

Results should look like this:

item1, description1, rank1, type33
item2, description2, rank2, type33
item3, description3, rank5, type33
item4, description4, rank6, type33
item5, description5, rank8, type33

--------

item6, descriptionv, rank1, type34
item7, descriptionw, rank2, type34
item8, descriptionx, rank3, type34
item9, descriptiony, rank4, type34
item10, descriptionz, rank5, type34

--------

item11, descriptionA, rank2, type36
item12, descriptionB, rank3, type36

using a do / while loop does displays all the items to display but not with any grouping. Is a ForEach loop the solution?

  • 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-01T00:33:03+00:00Added an answer on June 1, 2026 at 12:33 am

    If you’re talking about a visual grouping in your report output, then you’ll need to track that value for each loop iteration, and then issue your visual break when you detect a change. Something like this:

    $last_type = null;
    foreach ($records as $record) {
        if ($last_type !== null && $last_type != $record->fldType) {
            echo '<whatever your visual cue is>';
            $last_type = $record->fldType;
        }
    }
    

    Also, make sure you do:

    ORDER BY fldType, fldRank
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to integrate the functionality of creating dynamic pages (like google sites) to
I am creating a dynamic cursor and I would like to loop over the
I'm creating dynamic website with Php and Mysql. So i need insert bangla language
I have used Android phonegap application for creating dynamic list with label and corresponding
I am creating dynamic controls, in that one control is a button. I used
I am creating dynamic sites with the same code base, where I will need
I am creating dynamic controls using jQuery by reading the query string parameter. These
I'm creating a dynamic table where a user can add records(rows) and enter data.
I am creating dynamic text boxes on button click and then showing values on
I am creating Dynamic Rectangle and adding into StackPanel . I need to add

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.