Copy link to clipboard
Copied
Hi Guys and Gals,
Im in the process of building my portfolio, and im having trouble basically putting a repeat region in a repeat regionā¦. I shall try to explain.
Iāll be having a list of projects 'repeating' down the page, sorted ascending by project_id. 1, 2, 3 etc
At the same time, I will have images being generated from a different db table on the same db. Each image has a project_id according to which project their from. And I want them to be displayed in the same box as its project. Hence needing a second repeat regionā¦
Iāll most likely filter them out using an if statement⦠its just getting a repeat region inside a repeat region to work which is the problem.
Ive explored nested Repeat Regions in the past, but thats only been from drawing from one db table... so having no luck at the moment.
Any help would be greatly appreciated.
David
Copy link to clipboard
Copied
Can't you just join the project and image tables together in your sql statement and use one repeat region?
Copy link to clipboard
Copied
I would if I had a fixed amount of images per project.
Copy link to clipboard
Copied
you could just nest a loop inside of a loop.
so lets say I have a filed that seletces users and all the prerequesists are defined inside of a veriable called query. Than i want to select all of there grades
while($getter1 = mysql_fetch_array($query))
{
echo $geter1['user'];
echo "<br />";
$select = "select * from gradebook were user='" . $geter1['user'] . "'";
$run = mysql_query($select)or die(mysql_error());
$i=1;
while($getter2 = mysql_fetch_array($run))
{
echo "grade" . $i . ": " . $getter2['grade'];
$i = $i + 1;
}
}
Now in this situation this would not be the best way to get the grades but it demonstrates nested loops (repeatable region inside a repeatable reigon)like what you want. I do however agree with the other person who posted you should use an SQL Join.
Copy link to clipboard
Copied
>I would if I had a fixed amount of images per project.
Sorry, I still don't understand. Maybe you could explain what you are trying to do in a little more detail. Why does the number of images per project prevent you from using a single recordset and repeating region?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more