close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to repeat a region within another repeated region

Thread began 9/30/2010 7:09 am by rob75685 | Last modified 10/14/2010 10:14 am by Rune Brynestad | 1235 views | 8 replies |

rob75685

How to repeat a region within another repeated region

hi there

I have two tables - Departments and Contacts, with several contacts per department linked via department_ID

Can you give me some help displaying these details as follows:

Department 1

Contact1
Contact2
etc


Department 2

Contact1
Contact2
etc

I need to repeat through the departments and then repeat through the contacts within each department

I realise this is more php-related than DataAssist-related but any help would be much appreciated.

many thanks

Sign in to reply to this post

CraigRBeta Tester

what you need to do, is have 2 recordsets, one for departments and one for contacts, (and you probably have to hand code some of it because dreamweaver doesn't like to nest repeat regions)

start off with the departments recordset, unfiltered, displaying the department name in a repeat region.

then add the contacts recordset, WITHIN the repeat region, filtered by departmentID.

each increment of the loop should show only the contacts for each relevant department.

the contact name should be in a repeat region, within the departments repeat region

Sign in to reply to this post

rob75685

hi Craig

Thanks for your help - I've set up the nested repeat region but can you tell me how I do the filter please?...

Sign in to reply to this post

CraigRBeta Tester

Hi Rob.

coincidentally, I was just looking at this, as I am in the middle of testing my blog. (work in progress)

Take a look at this link, and download the finished page, I would be interested in your thoughts.

php-nested-recordsets-dreamweaver/

Regards

Sign in to reply to this post

Dave BuchholzBeta Tester

You can find an alternative way, written by David Powers, to do this here post_Create_nested_lists_from_a_recordset__PHP_-16720.html

I have used this to create drop down menus in the past and it works well.

Sign in to reply to this post

CraigRBeta Tester

Hi Dave, thanks for that.

There's usually more than one way, this seems like a neat solution

Sign in to reply to this post

Dave BuchholzBeta Tester

Yep a lot simpler than having to nest a recordset

Sign in to reply to this post

rob75685

hi Craig, Dave

Tried your suggestion Craig and this works great - a little fiddly at first but now i have a block of code that I can reuse in the future

Thanks for your help guys

Sign in to reply to this post

Rune Brynestad

DataAssist 3

This would be a nice one for DataAssist 3 I hope. Right now I depend on ADDT for cases like this. Basically this is the only reason that I still have ADDT installed on my computer.

Regards
Rune

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...