深圳全飞鸿

标题: Discuz查询内容的方法,表结构 [打印本页]

作者: zhgc    时间: 2019-9-30 16:48
标题: Discuz查询内容的方法,表结构
逻辑方法:

任意找到主题:比如:mysql show命令集合

在SQL文档中检索出现有三处

定位到每处后,再反向搜索insert  into `dz这个字符串,得到对应的表名:



insert  into `dz_forum_rsscache`(`lastupdate`,`fid`,`tid`,`dateline`,`forum`,`author`,`subject`,`description`,`guidetype`)
(1568998765,89,345,1568384476,'Mysql','zhgc','mysql show命令集合','mysql show命令集合','')


insert  into `dz_forum_thread`(`tid`,`fid`,`posttableid`,`typeid`,`sortid`,`readperm`,`price`,`author`,`authorid`,`subject`,`dateline`,`lastpost`,`lastposter`,`views`,`replies`,`displayorder`,`highlight`,`digest`,`rate`,`special`,`attachment`,`moderated`,`closed`,`stickreply`,`recommends`,`recommend_add`,`recommend_sub`,`heats`,`status`,`isgroup`,`favtimes`,`sharetimes`,`stamp`,`icon`,`pushedaid`,`cover`,`replycredit`,`relatebytag`,`maxposition`,`bgcolor`,`comments`,`hidden`)
(345,89,0,0,0,0,0,'zhgc',6,'mysql show命令集合',1568384476,1568384476,'zhgc',1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,-1,-1,0,0,0,'0',0,'',0,0)


insert  into `dz_forum_post`(`pid`,`fid`,`tid`,`first`,`author`,`authorid`,`subject`,`dateline`,`message`,`useip`,`port`,`invisible`,`anonymous`,`usesig`,`htmlon`,`bbcodeoff`,`smileyoff`,`parseurloff`,`attachment`,`rate`,`ratetimes`,`status`,`tags`,`comment`,`replycredit`,`position`)
(520,89,345,1,'zhgc',6,'mysql show命令集合',1568384476,'[i=s] 本帖最后由 zhgc 于 2019-9-13 22:36 编辑 ','36.153.62.153',41280,0,0,1,0,0,-1,0,0,0,0,0,'',0,0,1)
作者: zhgc    时间: 2019-9-30 16:59
例如查询内容有出现master-data的主题:

  1. select * from `dz_forum_thread` where dateline in (
  2. select dateline from dz_forum_post where message like '%master-data%')
复制代码





欢迎光临 深圳全飞鸿 (http://www.nagomes.com/disc/) Powered by Discuz! X3.2