运行分享方维购物分享系统2.2商业版程序的时候出现的错误
FANWE Database Error
The database has encountered a problem.
Error messages:[Type] dbquery_error
[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 ') LIMIT 0,20' at line 1
[Query] SELECT share_id,uid,content,collect_count,comment_count,create_time,cache_data FROM share WHERE share_id IN () LIMIT 0,20
  
Program messages:
[Line: 0027]note.php(NoteModule::goods)
[Line: 0011]core/module/note.module.php(NoteModule::show)
[Line: 0068]core/module/note.module.php(ShareService->getCollectShareByShare)
[Line: 2860]core/service/share.service.php(FDB->fetchAll)
[Line: 0170]core/class/db.class.php(FDB->_execute)
[Line: 0303]core/class/db.class.php(FDbMySql->fetchAll)
[Line: 0111]core/class/mysql.class.php(FDbMySql->query)
[Line: 0151]core/class/mysql.class.php(FDbMySql->halt)
[Line: 0233]core/class/mysql.class.php(FanweError->dbError)
[Line: 0121]core/class/error.class.php(FanweError->debugBacktrace)

解决方案 »

  1.   

    SELECT share_id,uid,content,collect_count,comment_count,create_time,cache_data FROM share WHERE share_id IN () LIMIT 0,20参数没有传递进去或者传递进去的参数为空值,自己检查一下吧。
      

  2.   

    这个是程序一个bug,在core/service/目录下share.service.php文件,条件判断出现了bug问题,下面两种修改方法,可以任选其中一种:方法一:移动条件
    $share_ids = array_unique($share_ids);
    将此行移动到
    if(count($share_ids) > 0)
    {
    $share_ids = array_unique($share_ids);//<--此处为移动过来的语句
    $list = FDB::fetchAll('SELECT share_id,uid,content,collect_count,comment_count,create_time,cache_data FROM '.FDB::table('share').' WHERE share_id IN ('.implode(',',$share_ids).') LIMIT 0,'.$num);
    $list = ShareService::getShareDetailList($list);
    }方法二:大约在2860行左右
    if(count($share_ids) > 0)
    {
    $list = FDB::fetchAll('SELECT share_id,uid,content,collect_count,comment_count,create_time,cache_data FROM '.FDB::table('share').' WHERE share_id IN ('.implode(',',$share_ids).') LIMIT 0,'.$num);
    $list = ShareService::getShareDetailList($list);
    }
    修改为:
    if(count($share_ids) > 0 && $share_ids) //增加判断$share_ids是否存在
    {
    $list = FDB::fetchAll('SELECT share_id,uid,content,collect_count,comment_count,create_time,cache_data FROM '.FDB::table('share').' WHERE share_id IN ('.implode(',',$share_ids).') LIMIT 0,'.$num);
    $list = ShareService::getShareDetailList($list);
    }