运行分享方维购物分享系统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)
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)
$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);
}