If you are trying to print children of a category, this should be sufficient:
<?php wp_list_categories('orderby=id&show_count=1&use_desc_for_title=0&child_of=".$term_id); ?>
Details here:
http://codex.wordpress.org/Template_Tags/wp_list_categories