[前台调用]查询指定分类的子分类DYCMS
<?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时,表示查询所有一级分类
$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时,表示查询所有一级分类
下一篇:[插件]仿QQ商城幻灯代码
我要评论