Skip to main content
Inspiring
Dec 10, 2010 5:57 PM UTC
Question

PHP Accordion by grouping

Good Day,

I would like to create a spry accordion from a Recordset.

My recordset has a category and exception.  So there could be 5 rows with the same category.

I would like to create an accordion that would show the category once and the content would list each exception within that category.

Just not sure how to creat the loop for this as I want it to loop on change of category.

Any tips is greatly appreciated!

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

nstrattonAuthor
Inspiring
Dec 12, 2010 12:24 AM UTC

Ok, figured out a solution with two queries.

1st query contains just a query grouping all the categories together.  I then run a loop on the accordion, tab section to list each category.

Inside that loop I run another query that is equal to the category in the loop.  From there I run another loop in the content section that displays all the results of that category.

Translate
Participant
Apr 26, 2011 5:14 PM UTC

Hey nstratton.  Thanks for that info. I also want to incorporate my Recordsets into accordions.  Could you please send me the coding to do so?   Your explanation is a bit too advanced for me at this stage.  Much appreciated.  G

Translate
nstrattonAuthor
Inspiring
Apr 26, 2011 5:32 PM UTC

I am trying to put the code, but it is converting to HTML.  Give me a few minutes to figure that out.

Translate