求救!
我在转 单独转换[短消息] 的时候
SQL: SELECT * FROM BBSXP_privatemessages WHERE messageid BETWEEN 6263 AND 9262
Errormsg: MSSQL ERROR
我看代码也没有问题
<?php
if($start <= 1) {
truncatetable('pms');
validid('messageid', 'privatemessages');
}
$query = $db['source']->query("SELECT * FROM {$source_tablepre}privatemessages WHERE messageid BETWEEN $start AND $end") or dexit("检索数据表 '{$source_tablepre}privatemessages' 错误!<br>请将短消息表 {$source_tablepre}privatemessages 字段类型为 nText 的改为 Text 类型。", 'mssql');
while($m = $db['source']->fetch_assoc($query)) {
$m = array_change_key_case(daddslashes($m));
//pms
$msgtoid = getuid($m['recipientusername']);
$str = "";
if($msgtoid > 0) {
$msgfrom = $m['senderusername'];
$msgfromid = getuid($m['senderusername']);
$folder = 'inbox'; //短消息所在文件夹(inbox=收件箱 outbox=草稿箱)
$new = $m['isread']; //新短消息(0=已读 1=未读 2=不再显示)
$subject = $m['subject'];
$dateline = sqltimetounix($m['createtime']);
$dateline = $dateline > $timestamp ? $timestamp : $dateline;
$message = @strip_tags(trim($m['body']));
$delstatus = $m['issenderdelete'] ? 1 : ($m['isrecipientdelete'] ? 2 : 0); //删除状态(0=无 1=发送者 2=接收者)
$sql = "INSERT INTO {$discuz_tablepre}pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message, delstatus) VALUES ('$msgfrom', '$msgfromid', '$msgtoid', '$folder', '$new', '$subject', '$dateline', '$message', '$delstatus');";
if($db['discuz']->query($sql)) {
$convertedrows ++;
} else {
reportlog("无法转换短消息 <br>".$sql."<br>".mysqlerror());
}
$totalrows ++;
}
$converted = 1;
}
?>
可就是报错,郁闷 |