Discuz教程网

Discuz重建主题表里记录的回帖数不等于实际数的sql脚本

[复制链接]
authicon dly 发表于 2015-10-13 12:19:12 | 显示全部楼层 |阅读模式
第一个是用来查看你的论坛数据库有多少这样的错误帖子记录
  1. select count(*) from
  2. (select tid,count(*)-1 replies from cdb_posts group by tid)a,cdb_threads b
  3. where a.tid=b.tid and a.replies<>b.replies
复制代码
第二个是用来修复所有的这些错误数据
  1. update cdb_threads a,(select tid,count(*)-1 replies from cdb_posts group by tid) b set a.replies=b.replies
  2. where a.tid=b.tid and a.replies<>b.replies
复制代码



上一篇:解决discuz x3多入口问题使文章、论坛、家园、群组域名独立的rewrite规则
下一篇:Discuz X3缩略图不显示水印的解决方法
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2024-5-2 07:04

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表