An error is reported when the POST request of an HTTP request is simulated by WinInet.

Source: Internet
Author: User
An error occurred in the POST request simulating HTTP in WinInet. This POST was last edited by dimply in 2014-06-0914: 02: 10. in VS2012, breakpoint tracking was set for execution, the following error message is returned when the php file is requested: Invalid & nbsp; query: & nbsp; You & nbsp; have & nbsp WinInet. An error occurred while simulating the http post request.

This post was last edited by dimply at 14:02:10 on

In VS2012, the resumable trace execution is set and the following error message is returned if the php file is requested:

Invalid query:
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 ''at line 1
Whole query:
Select id, name from index_activities where top = 0

This information is from PHP.
$result = mysql_query($query);

After the statement line, the "if" request is output only when the request is unsuccessful. it is obvious that the mysql request is unsuccessful and can be confirmed that the php file is successfully called.

However, when I call the same PHP file with the same parameters on the webpage (in the GET mode), the returned value is correct.

In my php file, it is used to retrieve passing parameters.
$top = $_REQUEST['top'];

Therefore, the POST and GET parameters can both be obtained.

I don't know where the problem may be? Does passing parameters with WinInet cause any exceptions in this request string?
------ Solution --------------------
Invalid query:
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 ''at line 1
Whole query:
Select id, name from index_activities where top = 0
This information is clearly a database error!

If $ query = "select id, name from index_activities where top = 0"; yes
$ Query = "select id, name from index_activities where top = $ top"; no
This indicates that $ top has no value or is not a number.
------ Solution --------------------
$ Top = $ _ REQUEST ['top']; change to $ top = intval ($ _ REQUEST ['top']); try

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.