Cakephp 2: need help on misconfiguration with PDOStatement
-
27-10-2019 - |
문제
I've got a problem with a request on Cakephp 2. When I try to put a '
or ?
in a string I get the error message
Error: SQLSTATE[HY093]: Invalid parameter number: no parameters were bound
[17:05:44] Root: #0 /var/home/public_html/lib/Cake/Model/Datasource/DboSource.php(436): PDOStatement->execute(Array)
This works on my local computer and all the local computers I've tried (all with WAMP installed). Only on the publication server do I get this issue.
Does anyone have a clue on this?
해결책
I fixed this error by upgrading php to 5.3.6
the version of 5.2 my old mamp was using had this bug: https://bugs.php.net/bug.php?id=44251
다른 팁
I got this too. What version of Cake2 are you using? Upgrading to the latest (2.0.5) fixed it for me.
If you are running a raw query beware of any ?s you may have in a comment. Looks like the PDO lib will try to replace those.