SQLSTATE[HY093]: Invalid parameter number: no parameters were bound, but parameters are provided

前端 未结 2 1424
春和景丽
春和景丽 2021-02-19 18:05

I\'m building a database object that joins the PDO object with the PDOStatement object in order for chaining to be available. Basically I just put the

2条回答
  •  遥遥无期
    2021-02-19 18:50

    Got the same error, but different cause

    My request had comments, one of which included a damn question mark.
    For PDO, a "?" is, of course, a parameter to bind.

    My request had no issue anywhere else, and I had no idea where PDO would invent a "parameter" while I wasn't using any, since I always use named placeholders, like :value


    Spent more than one hour on this :(
    May this answer help some people having this foolishly trivial issue.

提交回复
热议问题