搜索
查看: 3906|回复: 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-12-22 18:23 , Processed in 0.088755 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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