I found a very strange problem when dealing with bugs today. When performing certain operations, it will report: Invalid parameter number: no parameters were bound. However, the problem has not been reproduced locally or on the test machine. , I guessed whether it was related to the version, so I googled it and found http://forum.typecho.org/topic.php?id=1501 The second floor of the article said that the problem is a version bug, which is below php5.2.9 will appear in the pdo. So I found another machine (5.2.6) in the team to do the test, and the problem was indeed reproduced. When I tested it on 5.2.17 on his server, the problem did not appear.
During debugging, it was found that the following business reported the above error when this type of operation occurred:
Use PDO to the table nw_log (table fields such as uid and content fields) Insert a piece of data in the content field, where the content of the content field is test, and the content of the table field will call PDO before entering the database. ->quote method for escaping. On the php5.2.6 machine, the above error is reported, but on the 5.2.17 machine it behaves normally.
When I just modified the content to http://a.xxx/?tid=1, it behaved normally on both the 5.2.6 machine and the 5.2.17 machine, so I formatted the content again When debugging as test, the performance is normal on 5.2.6 and 5.2.17. It seems to be caused by single quotes. .