[前台调用]查询指定分类的子分类DYCMS

/ / 2016-10-19   阅读:2493
<?php $childsortsql="select id,mingcheng from article_sort where pid=1 and enable=0 order by paixu asc,id asc"; $childsortresult=$conn->query($childsortsql); if($childsortresult->num_rows&...
<?php
$childsortsql="select id,mingcheng from article_sort where pid=1 and enable=0 order by paixu asc,id asc";
$childsortresult=$conn->query($childsortsql);
if($childsortresult->num_rows>0){
while($childsortdata=$childsortresult->fetch_assoc()){
?>
<li><a href="article/list.php?sortid=<?php echo $childsortdata["id"]?>"><?php echo $childsortdata["mingcheng"]?></a></li>
<?php
}
}
?>

说明:pid=0时,表示查询所有一级分类

我要评论

昵称:
验证码:

最新评论

共0条 共0页 10条/页 首页 上一页 下一页 尾页
意见反馈