PDO version Problem Invalid parameter Number:no parameters were bound_php techniques

Source: Internet
Author: User

Today, when dealing with bugs, I find a very strange problem, in the execution of some kind of operation will be reported: Invalid parameter Number:no parameters were bound, but the problem on the local or test machine on the test did not reproduce, Guess whether and version, so Google, found http://forum.typecho.org/topic.php?id=1501 the second floor of the article said, the problem is a version of the bug, in the php5.2.9 below PDO will appear. So that is to find another team in the same machine (5.2.6) to do the test, and indeed reproduce the problem, his server on the 5.2.17 test, the problem did not appear.

When debugging, found that this type of operation has the following Business Report error:

Use PDO to insert a piece of data into the table nw_log (such as some column UID, and the content fields) in the Tables field, where the contents of the subject are <a href= ' http://a.xxx/?tid=1 ' >test</a> and the contents of the table field are invoked to escape the Pdo->quote method before entering the library. On the php5.2.6 machine is reported as a mistake, but on the 5.2.17 machine performance normal.

When I just changed the content to Http://a.xxx/?tid=1, on the 5.2.6 and 5.2.17 on the machine are normal, so again the content format debugging as <a href= "Http://a.xxx/?tid=1" > Test</a>, the 5.2.6 and 5.2.17 are all normal, it seems to be a single quotation mark of the trouble.

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.