本版
查看: 5694|回复: 0

[Discuz!] forum_filter_post 表出现错误

[复制链接]

Super Moderator

楼主(1#)
发表于 2013-6-23 18:24:14 | 只看该作者 |只看大图 |倒序浏览 |阅读模式
错误信息:
[color=rgb(0, 0, 0)][backcolor=rgb(243, 243, 243)][size=11pt](1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1[backcolor=rgb(255, 255, 204)][size=9pt]SELECT * FROM forum_filter_post WHERE tid=3684 ORDER BY postlength DESC LIMIT -1[/size][/backcolor]
[/size]
[/backcolor][/color]
[color=rgb(0, 0, 0)][backcolor=rgb(243, 243, 243)][size=11pt] [/size][/backcolor][/color]

[color=rgb(0, 0, 0)][backcolor=rgb(243, 243, 243)][size=11pt][backcolor=rgb(255, 255, 255)]解决办法:[/backcolor][/size][/backcolor][/color]

打开 \source\class\table\table_forum_filter_post.php
[color=rgb(0, 0, 0)][backcolor=rgb(243, 243, 243)][size=11pt][backcolor=rgb(255, 255, 255)]找到[/backcolor][/size][/backcolor][/color]
  1. public function fetch_all_by_tid_postlength_limit($tid, $limit = 10) {
    return DB::fetch_all('SELECT * FROM %t WHERE tid=%d ORDER BY postlength DESC LIMIT %d', array($this->_table, $tid, $limit), 'pid');
    }
[color=rgb(0, 0, 0)][backcolor=rgb(243, 243, 243)][size=11pt][backcolor=rgb(255, 255, 255)]修改成[/backcolor][/size][/backcolor][/color]
  1. public function fetch_all_by_tid_postlength_limit($tid, $limit = 10) {
    (float)$limit <= 0 && $limit = 10; //或者增加这一行
    return DB::fetch_all('SELECT * FROM %t WHERE tid=%d ORDER BY postlength DESC LIMIT %d', array($this->_table, $tid, $limit), 'pid');
    }
[color=rgb(0, 0, 0)][backcolor=rgb(243, 243, 243)][size=11pt][backcolor=rgb(255, 255, 255)]
[/backcolor]



[/size]
[/backcolor][/color]



回复

支持 | 反对  0 支持 / 0 反对 评分 举报

联系我们(Contact)|手机版|萝卜头IT论坛 ( 苏ICP备15050961号-1 )

GMT+8, 2026-10-21 01:15 , Processed in 0.07 second(s), 20 queries , Gzip On.

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