Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[已解决] 7.2云平台开通后运行记录MYSQL报错的解决方法

[复制链接]
otherbank 发表于 2012-1-2 12:29:28 | 显示全部楼层 |阅读模式
本帖最后由 otherbank 于 2012-1-2 12:30 编辑

根据一些站点反应,如:https://discuz.dismall.com/thread-2480761-1-1.html
https://discuz.dismall.com/thread-2514525-1-1.html等,
7.2升级云平台后——》工具——》运行记录——》系统记录;每天都有一样的MYSQL报错:my.php : 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 ') AND first = 1 AND invisible = '0'' at line 2 - SELECT * FROM cdb_posts


解决方法:
找到文件 api\manyou\class\Search.php 文件的638到648行:
  1. function _getThreadPosts($tIds) {
  2.                 global $tablepre, $db;
  3.                 $query = $db->query("SELECT * FROM {$tablepre}posts
  4.                                                          WHERE tid IN (" . implode($tIds, ', ') . ") AND first = 1 AND invisible = '0'"
  5.                                                    );
  6.                 $result = array();
  7.                 while($post = $db->fetch_array($query)) {
  8.                         $result[$post['tid']] = $this->_convertPost($post);
  9.                 }
  10.                 return $result;
  11.         }
复制代码
修改为:
  1. function _getThreadPosts($tIds) {
  2.                 global $tablepre, $db;
  3.                 if($tIds && is_array($tIds)){
  4.                         $query = $db->query("SELECT * FROM {$tablepre}posts
  5.                                                                  WHERE tid IN (" . implode($tIds, ', ') . ") AND first = 1 AND invisible = '0'"
  6.                                                            );
  7.                         $result = array();
  8.                         while($post = $db->fetch_array($query)) {
  9.                                 $result[$post['tid']] = $this->_convertPost($post);
  10.                         }
  11.                         return $result;
  12.                 }else{
  13.                         $result = array();
  14.                         return $result;
  15.                 }
  16.         }
复制代码

OK!!!

fa76 发表于 2012-1-3 09:35:52 | 显示全部楼层
;P;P
回复

使用道具 举报

xixi89 发表于 2012-1-4 09:56:58 | 显示全部楼层
回复

使用道具 举报

enen89 发表于 2012-1-4 10:39:57 | 显示全部楼层
回复

使用道具 举报

wei891 发表于 2012-1-4 10:41:20 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

li9y 发表于 2012-1-5 11:43:32 | 显示全部楼层
似水年华
回复

使用道具 举报

weyu78 发表于 2012-1-6 13:44:04 | 显示全部楼层
1978579889
回复

使用道具 举报

hayu12 发表于 2012-1-9 16:01:55 | 显示全部楼层
似水年华
回复

使用道具 举报

shan673 发表于 2012-1-11 16:23:47 | 显示全部楼层
求解决方法
回复

使用道具 举报

 楼主| otherbank 发表于 2012-1-11 16:26:25 | 显示全部楼层
shan673 发表于 2012-1-11 16:23
求解决方法

上面不是解决方法吗?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-10-4 13:32 , Processed in 0.146541 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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