Ok,
I don't know what the classes do but generally you can do something like this:
First select the categories and create a array out of them that looks like:
$cats = array("catid1" => "catname1","catid2" => "catname2", ....)
Then get the subcategories (the rows catid,subcatid,subcatname) with the second query, walk through the result set and create an array that looks like
$subcats = array("catid1" => array("subid1" => "subname1","subid2" => "subname2", ....),
"catid2" => array("subid3" => "subname3", "subid4" => "subname4",...),
......)
You should then be able to print the data with something like:
foreach ($cats as $key => $value) {
echo $cats[$key]."<br>\n";
if (isset($subcats[$key]) && is_array($subcats[$key])) {
foreach ($subcats[$key] as $key2 => $value2) {
echo "--".$value2."<br>\n";
}
}
}
You might need to tweak the code a little bit to fit into your classes but something like that should work.
Thomas