運行分享方維購物分享系統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)
回複討論(解決方案)
SELECT share_id,uid,content,collect_count,comment_count,create_time,cache_data FROM share WHERE share_id IN () LIMIT 0,20
參數沒有傳遞進去或者傳遞進去的參數為空白值,自己檢查一下吧。
不知道在哪改
貼出你的SQL語句。
貼出你的SQL語句。
是網站程式,我也不知道在哪
安裝網站時把測試資料也安裝進去試試。。。說來說去還是網站程式垃圾
這個是程式一個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);}
修複成功了!