$cp_nav=array();
$db->Query('cpclass1','select * from #@__type where parent=2 ORDER BY `ORDER` ,`ID` ');
while($row1 = $db->GetArray('cpclass1')){
$db->Query('cpclass2',"select * from #@__type where parent='$row1[id]' ORDER BY `ORDER` ,`ID` LIMIT 5");
while($row2 = $db->GetArray('cpclass2')){
$cp2[]=$row2;
$db->Query('cpclass3',"select * from #@__type where parent='$row2[id]' ORDER BY `ORDER` ,`ID` LIMIT 5");
while($row3 = $db->GetArray('cpclass3')){
$cp3[]=$row3;
}
}
$row2['cp3']=$cp3;
$row1['cp2']=$cp2;
$cp_nav[]=$row1;
}
$qf->assign('cp_nav',$cp_nav);