Home > Backend Development > PHP Tutorial > 这个问题怎么解决啊,求求各位了

这个问题怎么解决啊,求求各位了

WBOY
Release: 2016-06-23 14:03:10
Original
812 people have browsed it

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


将此行移动到

			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);			}
Copy after login


方法二:大约在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);			}
Copy after login


修改为:

			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);			}
Copy after login

修复成功了!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template