Hello, All
I haven't written in for a while so this little puzzler marks a fitting return to the fold.
There are 3 elements to consider:
1) Category pages
2) Panels
3) Boxes
Each element is nested inside the other. The boxes sit the panels which sit on the Category pages.
A panel can be assigned to any of the Category pages (via a multi-select menu called "categorySelector").
Multiple boxes can be assigned to each panel (each via a multi-select menu called "panelSelector").
Thus far I have the panels rendering on the right Category pages, using the following code:
list($panelRecords, $panelMetaData) = getRecords(array(
'tableName' => 'panel',
'where' => "categorySelector LIKE '%\t{$selectedCategory['num']}\t%'",
));
...which seems to work.
What I can't work out is how to filter the right boxes to appear on the panels.
I'm working with something like this...
$activePanels = array();
foreach($panelRecords as $panels){
if($panels['categorySelector'] == $selectedCategory['num']){
$activePanels[] = $panels;
}
}
list($boxesRecords, $boxestMetaData) = getRecords(array(
'tableName' => 'boxes',
'where' => " '%\t{panelSelector}\t%' IN ('%\t{$activePanels}\t%')",
));
It doesn't work. I'm sure I'm close but I can't quite nail it....
Help!
:0)
Perch