热搜词
发表于 2013-5-6 14:34:57 | 显示全部楼层 |阅读模式
代码:
统计文章总数
{pc:get sql="SELECT count(*) as zs FROM phpcms_news "}
{loop $data $key $r}
{$r[zs]}
{/loop}
{/pc}

代码二:
统计某位会员发帖数量
{pc:get sql="SELECT count(*) as userconut FROM phpcms_news where username = '某会员名称' "}
{loop $data $key $r}
{$r[userconut]}
{/loop}
{/pc}

注:
select count(*)  查每个表有多少条记录



全部评论0
回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|管理员之家 ( 苏ICP备2023053177号-2 )

GMT+8, 2024-11-25 00:26 , Processed in 0.187736 second(s), 26 queries .

Powered by Discuz! X3.5

Cpoyright © 2001-2024 Discuz! Team