private function getChild($id, $cur_node){ global $cfg, $database; $getChild_query = "SELECT `cat_id` FROM `".$cfg['db_prefix']."cat` WHERE `cat_parent_id` = ".$id; foreach ($database->query($getChild_query) as $getChild){ $cur_node[$id][$getChild['cat_id']] = $this->getChild($getChild['cat_id'], $cur_node[$id]); } return $cur_node; }