{"record":{"id":"478234d286d7bcb8","repo":"phalcon/cphalcon","slug":"bound-parameter-wildcard-cannot-be-replaced-be","errorCode":null,"errorMessage":"Bound parameter '{wildcard}' cannot be replaced because it is not in the placeholders list","messagePattern":"Bound parameter '(.+?)' cannot be replaced because it is not in the placeholders list","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\Query\\Exceptions\\BindParameterNotInPlaceholders","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Query.zep","lineNumber":1035,"sourceCode":"                case PHQL_T_DOUBLE:\n                    let insertValue = dialect->getSqlExpression(exprValue);\n                    break;\n\n                case PHQL_T_NULL:\n                    let insertValue = null;\n                    break;\n\n                case PHQL_T_NPLACEHOLDER:\n                case PHQL_T_SPLACEHOLDER:\n                case PHQL_T_BPLACEHOLDER:\n                    let wildcard = str_replace(\n                        \":\",\n                        \"\",\n                        dialect->getSqlExpression(exprValue)\n                    );\n\n                    if unlikely !fetch insertValue, bindParams[wildcard] {\n                        throw new BindParameterNotInPlaceholders(wildcard);\n                    }\n\n                    break;\n\n                default:\n                    let insertValue = new RawValue(\n                        dialect->getSqlExpression(exprValue)\n                    );\n\n                    break;\n            }\n\n            let fieldName = fields[number];\n\n            /**\n             * If the user didn't define a column list we assume all the model's\n             * attributes as columns\n             */","sourceCodeStart":1017,"sourceCodeEnd":1053,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Query.zep#L1017-L1053","documentation":"While building the INSERT SQL, Query resolves placeholders from the statement against the supplied bindParams; if a wildcard (named/positional/bound placeholder) is absent from the placeholders list, this error is thrown. The faulty input is a bind parameter referenced in PHQL but not provided in bindParams.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Query.zep:1035 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a bind param for every :name:/? placeholder used in the statement","Fix placeholder name typos between the PHQL and the bind array","Ensure bind params are merged into the execute()/insert call actually used"],"exampleFix":"$query->execute(['name' => 'Robot'], ['name' => Column::BIND_PARAM_STR]);","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build placeholders and bindings from the same data structure","Assert count of placeholders equals count of bind params in tests"],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","contentChangedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}