gpt4 book ai didi

php - 自定义 PDO 类错误

转载 作者:搜寻专家 更新时间:2023-10-31 21:14:35 26 4
gpt4 key购买 nike

EDIT: It turns out that I've been barking up the wrong tree so to speak. I've edited the question to make it at least useful for others who get the error.

对于所有在尝试执行准备好的 PDO 查询时遇到以下错误的人:

Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined on line 26

请看下面我的回答。

最佳答案

如果我错了请纠正我,但是你不应该为你的参数数组使用以下语法吗:

array(':id' => 1)

请注意原始帖子中省略的冒号。

参见 PDO docs例如。

关于php - 自定义 PDO 类错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11868268/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com