Hi Jesus,
That solution would definitely work. The only issue I can see is that on any given page, you would load at least 3 record sets that would never be used. To help keep the code clean, what you can do is use an if statement to figure out which table you should be getting records from and only load a single record set.
NOTE: In this example I'm assuming that your tables are called sub1, sub2, etc
if ($productsRecord['category'] == "SUB1") {
$tableName = 'sub1';
}
elseif ($productsRecord['category'] == "SUB2") {
$tableName = 'sub2';
}
elseif ($productsRecord['category'] == "SUB3") {
$tableName = 'sub3';
}
else {
$tableName = 'sub4';
}
list($subcategoryRecords, $subMetaData) = getRecords(array(
'tableName' => $tableName,
'allowSearch' => false,
));
This way, in your code you can always just output $subcategoryRecords without having to worry about which record set you need.
Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/