Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

[疑问] 搬家后帖子空了,数据库有帖子数据

[复制链接]
白乐天 发表于 2009-7-30 09:09:59 | 显示全部楼层
threads表受损是可以勉强补救的,问题是,通常threads表受损,posts表也不会无恙。你先看看posts表的数据是否完整,记录数是否等于你的帖子数。
回复

使用道具 举报

桃子(小敏) 发表于 2009-7-30 09:16:32 | 显示全部楼层
您检查下备份数据中有没有threads表的数据,如果没有,那就是备份时没备份上
如果有,那就是恢复不成功,建议使用tools工具恢复:
https://discuz.dismall.com/thread-1024280-1-1.html
回复

使用道具 举报

 楼主| linyuefeng 发表于 2009-7-30 09:30:54 | 显示全部楼层
posts表完整的。里面的帖子数是正常的。我试试修复。。
回复

使用道具 举报

 楼主| linyuefeng 发表于 2009-7-30 09:35:39 | 显示全部楼层
应该是全部备份的时候没备份上吧。。修复不了。
回复

使用道具 举报

白乐天 发表于 2009-7-30 09:40:48 | 显示全部楼层
posts表完整的话,可以参考这个帖子,用posts表数据补充threads表
http://www.xszhy.cn/bbs/thread-1552-1-1.html
版本未必适合7.0,自己要改一点点。
回复

使用道具 举报

 楼主| linyuefeng 发表于 2009-7-30 09:42:02 | 显示全部楼层
<?
require_once './include/common.inc.php';

$query = $db->query("SELECT * FROM {$tablepre}posts where first = 1");

while($post = $db -> fetch_array($query)) {
        $tid = $post['tid'];
        $fid = $post['fid'];
        $readperm = 0;
        $price = 0;
        $iconid = 0;
        $typeid = 0;
        $author = $post['author'];
        $discuz_uid = $post['authorid'];
        $subject = addslashes($post['subject']);
        $timestamp = $post['dateline'];
        $timestamp1 = $post['dateline'];
        $author = $post['author'];
        $displayorder = 0;
        $digest = 0;
        $blog = 0;
        $special = 0;
        $attachment = $post['attachment'];
        $subscribed = 0;
        $moderated = 0;
        $supe_pushstatus = 0;
                $threadquery = $db->query("select tid from {$tablepre}threads where tid=$tid");
                if(!$tidarray = $db->fetch_array($threadquery)){
      
                        $db->query("INSERT INTO {$tablepre}threads (tid, fid, readperm, price, iconid, typeid, author, authorid, subject, dateline, lastpost, lastposter, displayorder, digest, blog, special, attachment, subscribed, moderated, supe_pushstatus)
                VALUES ('$tid', '$fid', '$readperm', '$price', '$iconid', '$typeid', '$author', '$discuz_uid', '$subject', '$timestamp', '$timestamp1', '$author', '$displayorder', '$digest', '$blog', '$special', '$attachment', '$subscribed', '$moderated', '$supe_pushstatus')");
                }else{
                        echo "已经存在
";
                }
}
echo '完毕';


?>

要修改哪里吗?我不是很懂哈。呵呵
回复

使用道具 举报

蓝豆 发表于 2009-7-30 09:56:27 | 显示全部楼层
保存为.php格式的文件 放到论坛目录下执行
回复

使用道具 举报

 楼主| linyuefeng 发表于 2009-7-30 10:24:23 | 显示全部楼层
不行啊,这个错误
Discuz! info: MySQL Query Error

User: 永恒
Time: 2009-7-30 10:23am
Script: /threads.php

SQL: INSERT INTO [Table]threads (tid, fid, readperm, price, iconid, typeid, author, authorid, subject, dateline, lastpost, lastposter, displayorder, digest, blog, special, attachment, subscribed, moderated, supe_pushstatus)
VALUES ('2', '2', '0', '0', '0', '0', '永恒', '2', 'hi', '1241769780', '1241769780', '永恒', '0', '0', '0', '0', '1', '0', '0', '0')
Error: Unknown column 'blog' in 'field list'
程序文件跟数据库有冲突,请使用正确的程序文件上传上去覆盖详细解决方案请点击这里
回复

使用道具 举报

 楼主| linyuefeng 发表于 2009-7-30 10:26:16 | 显示全部楼层
本帖最后由 linyuefeng 于 2009-7-30 10:40 编辑

要修改哪几个地方?恳请高手修改成7.0可用的。
回复

使用道具 举报

 楼主| linyuefeng 发表于 2009-7-30 13:48:52 | 显示全部楼层
自己修改了,已经搞定了。。。。在此感谢:白乐天 桃子(小敏)  蓝豆 huihui0103 的热心解答
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-9-16 03:06 , Processed in 0.108530 second(s), 12 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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