通过SQL语句手动向DISCUZ x2 插入帖子数据

-- 转存表中的数据 `pre_forum_post`

INSERT INTO `pre_forum_post` (`pid`, `fid`, `tid`, `first`, `author`, `authorid`, `subject`, `dateline`, `message`, `useip`, `invisible`, `anonymous`, `usesig`, `htmlon`, `bbcodeoff`, `smileyoff`, `parseurloff`, `attachment`, `rate`, `ratetimes`, `status`, `tags`, `comment`, `replycredit`) VALUES
(5, 36, 4, 1, 'admin', 1, '这又是一条帖子', 1311173433, '这当然是内容啦\r\n从前....结束\r\n', '127.0.0.1', 0, 0, 1, 0, -1, -1, 0, 0, 0, 0, 0, '', 0, 0);

-- 转存表中的数据 `pre_forum_thread`

INSERT INTO `pre_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`) VALUES
(5, 36, 0, 0, 0, 0, 0, 'admin', 1, '这又是一条帖子', 1311173433, 1311173433, 'admin', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, -1, -1, 0, 0, 0);

-- 转存表中的数据 `pre_forum_post_tableid`

INSERT INTO `pre_forum_post_tableid` (`pid`) VALUES (5);

-- 更新 pre_forum_forum 表

UPDATE `pre_forum_forum` SET threads='threads+1', posts='posts+1', lastpost='5   这又是一条帖子   1311173433   admin' WHERE fid='36';

--- 首先要查找一下 pre_forum_post (pre_forum_post_tableid 和他的pid是一样的) 的 pid最大值 、 pre_forum_thread 的 tid 最大值 ,由查出来的起始id+1 作为新的id。
--- 36 是帖子栏目的ID
-- threads+1 、posts+1 这个当然是要先去查结果。
-- 通过以上操作我们就完成了通过sql语句手动向 discuz x2 论坛插入帖子。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值