萝卜头IT论坛

搜索
查看: 2503|回复: 0
收起左侧

[Discuz!] forum_filter_post 表出现错误

[复制链接]
发表于 2013-6-23 18:24:14 | 显示全部楼层 |阅读模式
错误信息:
(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 1SELECT * FROM forum_filter_post WHERE tid=3684 ORDER BY postlength DESC LIMIT -1

post.JPG

解决办法:

打开 \source\class\table\table_forum_filter_post.php
找到
  1. public function fetch_all_by_tid_postlength_limit($tid, $limit = 10) {
  2.     return DB::fetch_all('SELECT * FROM %t WHERE tid=%d ORDER BY postlength DESC LIMIT %d', array($this->_table, $tid, $limit), 'pid');
  3. }
复制代码
修改成
  1. public function fetch_all_by_tid_postlength_limit($tid, $limit = 10) {
  2.     (float)$limit <= 0 && $limit = 10; //或者增加这一行
  3.     return DB::fetch_all('SELECT * FROM %t WHERE tid=%d ORDER BY postlength DESC LIMIT %d', array($this->_table, $tid, $limit), 'pid');
  4. }
复制代码









回复

使用道具 举报

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

GMT+8, 2024-4-23 16:32 , Processed in 0.097561 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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