//获得指定分类的子分类,参数为分类ID
function getsubcategoryinfo($categoryid){
$db = MySql::getInstance();
$sortid = intval($categoryid) ? $categoryid : -1;
$sql = "SELECT * FROM ".DB_PREFIX."sort WHERE pid = ".$sortid;
$sql = $db->query($sql);
$result = array();
$i = 0;
while($row = $db->fetch_array($sql)){
$result[$i]['sid'] = $row['sid'];
$result[$i]['sortname'] = $row['sortname'];
$result[$i]['alias'] = $row['alias'];
$result[$i]['taxis'] = $row['taxis'];
$result[$i]['pid'] = $row['pid'];
$result[$i]['description'] = $row['description'];
$result[$i]['template'] = $row['template'];
$i++;
}
return $result;
}
?>
数组输出每个子分类的id,名称,别名,序号,父分类id,分类描述和分类模板
网友评论