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

t0532 2012-06-29 09:44:02
运行分享方维购物分享系统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)
...全文
1866 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
cncncncn 2013-03-18
  • 打赏
  • 举报
回复
修复成功了!
freenow8 2012-09-24
  • 打赏
  • 举报
回复
这个是程序一个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);
}
timgzhu 2012-06-30
  • 打赏
  • 举报
回复
安装网站时把测试数据也安装进去试试。。。说来说去还是网站程序垃圾
kvncn 2012-06-29
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]

贴出你的SQL语句。
[/Quote]

是网站程序,我也不知道在哪
一起混吧 2012-06-29
  • 打赏
  • 举报
回复
贴出你的SQL语句。
t0532 2012-06-29
  • 打赏
  • 举报
回复
不知道在哪改
乌镇程序员 2012-06-29
  • 打赏
  • 举报
回复
SELECT share_id,uid,content,collect_count,comment_count,create_time,cache_data FROM share WHERE share_id IN () LIMIT 0,20

参数没有传递进去或者传递进去的参数为空值,自己检查一下吧。

20,359

社区成员

发帖
与我相关
我的任务
社区描述
“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
phpphpstorm 技术论坛(原bbs)
社区管理员
  • 开源资源社区
  • phpstory
  • xuzuning
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧