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

 找回密码
 立即注册
搜索

[转换] 大家看看有什么错误吗?

[复制链接]
hkstar35 发表于 2008-12-8 16:57:28 | 显示全部楼层 |阅读模式
<?php
        if($start <= 1) {
                truncatetable('threads');
                truncatetable('polls');
                truncatetable('polloptions');
                validid('ID', '[forum]');
        }

        $query = $db['source']->query("SELECT * FROM [forum] WHERE ID BETWEEN $start AND $end") or dexit("检索数据表 '{$source_tablepre}[forum]' 错误!<br>请将主题表 '{$source_tablepre}[forum]' 字段类型为 nText 的改为 Text 类型。", 'mssql');
                while($t = $db['source']->fetch_assoc($query)) {
                        $t = array_change_key_case(daddslashes($t));
       
                        $tid                        =        $t['ID'];
                        $fid                        =        $t['forumid'];
                        $iconid                        =        0;
                        $typeid                        =        0;
                        $readperm                =        0;
                        $price                        =        0;
                        $author                        =        cutstr(htmlspecialchars(trim($t['username'])), 50);
                        $authorid                =         0;
                        $subject                =        cutstr(htmlspecialchars(trim(@strip_tags($t['topic']))), 78);
                        $dateline                =        sqltimetounix($t['posttime']);
                        $lastpost                =        sqltimetounix($t['lasttime']);
                        $lastposter                =        cutstr(htmlspecialchars(trim($t['lastname'])), 50);
                        $views                        =        $t['views'];
                        $replies                =        $t['replies'];
                        $displayorder                =        $t['deltopic'] ? '-1' : ($t['toptopic'] > 3 ? 3 : $t['toptopic']);
                        $highlight                =        0;
                        $digest                        =        $t['goodtopic'];
                        $rate                        =        0;
                        $blog                        =        0;
                        $poll                        =        0;
                        $attachment                =        0;
                        $subscribed                =        0;
                        $moderated                =        0;
                        $closed                        =        $t['locktopic'];

                        $sql1 = "INSERT INTO {$discuz_tablepre}threads (
                                `tid` , `fid` , `iconid` , `typeid`, `readperm`, `price`,`author` , `authorid` , `subject` , `dateline` , `lastpost` , `lastposter` , `views` , `replies` , `displayorder` , `highlight` , `digest` , `rate` , `blog` , `special` , `attachment` , `subscribed`, `moderated` , `closed`
                                ) VALUES(
                                '$tid', '$fid', '$iconid', '$typeid', '$readperm', '$price', '$author', '$authorid', '$subject', '$dateline', '$lastpost', '$lastposter', '$views', '$replies', '$displayorder', '$highlight', '$digest', '$rate', '$blog', '$poll', '$attachment', '$subscribed', '$moderated', '$closed');";

                        if($db['discuz']->query($sql1)){
                                $convertedrows ++;
                        } else {
                                reportlog("无法转换主题 tid = $tid subject = '$subject',SQL 语句如下 :<br><textarea rows=\"3\" style=\"width: 100%;\">".$sql1."</textarea>");
                        }
                        $converted = 1;
                        $totalrows ++;
                }
?>

SQL: SELECT * FROM [forum] WHERE ID BETWEEN 3 AND 3002
Errormsg: MSSQL ERROR

我的程序是版本:Discuz! 6.1.0
回复

使用道具 举报

beijing200808 发表于 2008-12-9 09:55:31 | 显示全部楼层
ntext改成text类型了吗?
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-9-16 23:28 , Processed in 0.095132 second(s), 14 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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