nkc3g4 发表于 2013-6-23 18:24:14

forum_filter_post 表出现错误

错误信息:
(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



解决办法:

打开 \source\class\table\table_forum_filter_post.php
找到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');
}修改成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');
}








页: [1]
查看完整版本: forum_filter_post 表出现错误