帝国CMS模板当前专题或者指定专题信息数量统计的几种方法
<?=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsztinfo where ztid='$GLOBALS[navclassid]'")?>
2、统计专题文章数量
①sql代码
<?
$num=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsztinfo where ztid=专题id");
echo $num;
?>
注释:(ztid=专题id 可以修改为 ztid=ztid)
②灵动标签+php
[e:loop={"select ztpath,ztname,ztid from [!db.pre!]enewszt where zcid=0",36,24,0}]
<li>
<a href="<?=$bqr[ztpath]?>"><?=$bqr[ztname]?></a>
(<? $num=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsztinfo where ztid='$bqr[ztid]'");
echo $num;?>)
</li>
[/e:loop]
相关推荐
标签:
留言与评论(共有 0 条评论) |