Help with nested repeat region
I've been playing around with this for a while, but haven't been able to get it right. Have been looking at DA's repeating table and Tom Muck's nested region behaviour, but haven't got it to work with either. Plus I'm a little unsure if I need one or two SQL queries.
Anyway, this is the page that is closest, but has no nested repeat applied:
Basically where there are two instances of 'Test Itinerary' (one for each of Tanzania and Kenya), I just want one instance to list Tanzania and Kenya together.
The table structure is:
ItineraryID, Itinerary etc
ActivityID, Activity, etc
And currently one SQL query:
SELECT * FROM itineraries INNER JOIN ItineraryActivities ON ItineraryActivities.ItineraryID = itineraries.ItineraryID INNER JOIN activities ON activities.ActivityID = ItineraryActivities.ActivityID WHERE Publish_GSG = 'Yes' AND Category_Order = 1
(Category_Order refers to countries in the activities table)
Basically I just need this code to repeat:
<td><img src="../../itinerary_resources/icons/<?php echo $row_SecurityAssisttradeusers['Icon']; ?>" width="30" height="20" alt="Country Flag" /></td>
<td><h2><?php echo $row_SecurityAssisttradeusers['Activity']; ?></h2></td>
Rather than it display duplicate entries for itineraries where more than one country is linked to the itinerary.
Hope that makes sense - I've attached a copy of that file.