1、统计当前专题内的文章数量
<?=$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]
评论前必须登录!
立即登录 注册