Ecshop Background SQL query hint error This SQL may contain Update,delete,truncate,alter,drop,flush,insert

Source: Internet
Author: User

a),
First of all, let's say the error phenomenon:
Most of the popular Ecshop templates on the market need to execute a paragraph or a few SQL statements to modify the data structure or initialize some of it.
Most Ecshop administrators will execute these SQL statements through the Ecshop backend database management SQL query for the sake of convenience.
The problem is that when you paste into the SQL statement and click "Submit Query", the system will report the following error:
This SQL may contain update,delete,truncate,alter,drop,flush,insert,replace,set,create,concat

Attention:
The above error will only appear under the system with the latest patch ECSHOP2.7.3, if your ecshop system does not hit the latest patch, this error will not occur.

Here's the reason for the error:

The above error prompts, because ECSHOP2.7.3 the latest patch files, the ecshop background of the "SQL query" function is limited,
Only select query statements are allowed, and SQL statements such as ALTER, UPDATE, DELETE, truncate, and so on, except for select, are forbidden.



II),

Let's talk about the workaround:

Open admin/sql.php Find the following code, delete can

if(!Empty($_post[' SQL '])){Preg_match_all("/(SELECT)/i",$_post[' SQL '],$matches);if(isset($matches[1]) &&Count($matches[1]) >1) {sys_msg ("This SQL more than one select");}if(Preg_match("/(update| delete| truncate| alter| drop| flush| Insert| replace| Set| create| CONCAT)/I ",$_post[' SQL ']) {sys_msg ("This SQL may contain Update,delete,truncate,alter,drop,flush,insert,replace,set,create,concat");}}

Ecshop Background SQL query hint error This SQL may contain Update,delete,truncate,alter,drop,flush,insert

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.