找回密码
 立即注册
搜索

途迹耕耘

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

GMT+8, 2025-12-22 00:47 , Processed in 0.172539 second(s), 13 queries .

[DZ教程] 所有分区的SQL调用

[复制链接]
DZ教程 发表于 2021-6-7 21:55:52 | 显示全部楼层 |阅读模式
获取所有分区
  1. $forums = DB::fetch_all("SELECT fid,name FROM ".DB::table('forum_forum')." where type = 'group' and status = 1");
复制代码


获取分区下的板块
  1. foreach($forums as $v) {
  2.            $forums[$v['fid']]['forum'] = DB::fetch_all("SELECT fid,name FROM ".DB::table('forum')." where fup=".v['fid']." and status = 1");
  3. }
复制代码