How do you solve this problem, please?

Source: Internet
Author: User
Error occurred while running the 2.2 business version of the shared square shopping sharing system
Fanwe Database Error
The database has encountered a problem.
Error messages:

[Type] Dbquery_error
[1064] You have a error in your SQL syntax; Check the manual-corresponds to your MySQL server version for the right syntax-use-near ') LIMIT 0,20 ' on 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)


Reply to discussion (solution)

SELECT share_id,uid,content,collect_count,comment_count,create_time,cache_data from Share WHERE share_id in () LIMIT 0,20

Parameters that are not passed in or passed in are null values, check it yourself.

I don't know where to change.

Paste out your SQL statement.

Paste out your SQL statement.

It's a website program, and I don't know where it is.

Install the test data in the installation of the site to try ... The website program Rubbish

This is a bug in the program, in the core/service/directory under the share.service.php file, the conditions to determine the issue of a bug, the following two ways to modify, you can choose either:

Method One: Move condition

$share _ids = Array_unique ($share _ids);


Move this line to

if (count ($share _ids) > 0) {$share _ids = Array_unique ($share _ids)//<--Here is the statement moved over $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);}


Method Two: About 2860 rows or so

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);}


Modified to:

if (count ($share _ids) > 0 && $share _ids)//Add to determine if $share_ids exists {$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);}

The repair is successful!

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    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.