//递归获取大类中的所有小类
function get_children($tid){
global $db,$table;
if($row = $db->getAll("SELECT tid FROM `{$table}article_type` WHERE pid = $tid")){
foreach ($row as $k => $v){
$str.= $v['tid'].',';
$tem = get_children($v['tid']);
if($tem!=$v['tid'])$str.= $tem.',';
}
$str = substr($str,0,strlen($str)-1);
return $str;
}else{
return $tid;
}
}