• 首页
  • 需求
  • 报摘
  • 视频
  • 娱乐
  • 游戏
  • 酷图
  • 军事
  • 历史
  • 电脑
  • 手机
  • 软件
  • 汽车
  • 社会
  • 健康
  • 科技
  • 旅游
  • 体育
  • 财经
  • 公益
  • 慈善
  • 专题
  • 满足您需
  • Google
    站内
    当前位置 :| 主页>电脑>数据库>

    Dede2007RC1,移动文章时出现addtable字段出错的解决办法

    来源: 作者: 时间:2008-03-10 点击:
    Dede2007RC1,移动文章时,会显示错误,原因在/dede目录下的 archives_do.php 第268行
    Copy code
    $arcrow = $dsql->GetOne("Select channel,typeid,addtable From sanf_archives where ID='$arcid' ");


    addtable 这个字段不是在sanf_archives 表中的,所以会出错.论坛中以前有人给过解决办法,见此:
    http://bbs.dedecms.com/read.php?tid=39325&keyword=addtable

    但在sanf_archives 中加入addtable 字段的办法是治标不治本的,这样虽然不会出错了,但下面一句
    Copy code
    $dsql->ExecuteNoneQuery("Update `{$arcrow['addtable']}` Set typeid='$targetTypeid' where aid='$arcid' ");
    也不能执行了,这样最终的结果只移了一半.

    正确的解决办法如下:
    将 archives_do.php 中的
    Copy code
    $arcrow = $dsql->GetOne("Select channel,typeid,addtable From sanf_archives where ID='$arcid' ");

    这句改为:
    Copy code
    $arcrow = $dsql->GetOne("Select sanf_archives.channel,sanf_archives.typeid,sanf_channeltype.addtable From sanf_archives,sanf_channeltype where sanf_archives.channel=sanf_channeltype.ID and sanf_archives.ID='$arcid' ");


    即可,大家一看代码就明白了,就不在解释了.
    最新评论共有 0 位网友发表了评论
    发表评论
    评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
    用户名: 密码:
    匿名?
    注册