投稿 评论 顶部
 手机版 | 登陆 | 注册 | 留言 | 设首页 | 加收藏

discuz x3.2查询数据表并单独使用字段调用数据代码

佚名 discuz教程
$daythreads = DB::query("SELECT todayposts,yesterdayposts,threads,posts FROM ".DB::table('forum_forum')." WHERE type='forum'");while($dayt = DB::fetch($daythreads)) {$todayposts += $dayt['todayposts'];$yesterdayposts += $dayt['yesterdayposts'];$threads += $dayt['threads'];$posts += $dayt['posts'];}

复制代码
{$todayposts}今日发帖数{$yesterdayposts}昨日发帖数{$threads}主题数{$posts}帖子数