這個問題怎麼解決啊,求求各位了

來源:互聯網
上載者:User
運行分享方維購物分享系統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);}

修複成功了!

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.