phalcon/cphalcon · error · Phalcon\Mvc\Model\Query\Exceptions\BindParameterNotInPlaceholders
Bound parameter ' ' cannot be replaced because it is not in…
Error message
Bound parameter '{wildcard}' cannot be replaced because it is not in the placeholders list What it means
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.
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
Example fix
$query->execute(['name' => 'Robot'], ['name' => Column::BIND_PARAM_STR]);
Defensive patterns
Strategy: validation
Prevention
- Build placeholders and bindings from the same data structure
- Assert count of placeholders equals count of bind params in tests
When it happens
Trigger: Thrown at phalcon/Mvc/Model/Query.zep:1035 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21).
Data as JSON: /api/errors/478234d286d7bcb8.
Report an issue: GitHub.
Appendix: source
Thrown at phalcon/Mvc/Model/Query.zep:1035
case PHQL_T_DOUBLE:
let insertValue = dialect->getSqlExpression(exprValue);
break;
case PHQL_T_NULL:
let insertValue = null;
break;
case PHQL_T_NPLACEHOLDER:
case PHQL_T_SPLACEHOLDER:
case PHQL_T_BPLACEHOLDER:
let wildcard = str_replace(
":",
"",
dialect->getSqlExpression(exprValue)
);
if unlikely !fetch insertValue, bindParams[wildcard] {
throw new BindParameterNotInPlaceholders(wildcard);
}
break;
default:
let insertValue = new RawValue(
dialect->getSqlExpression(exprValue)
);
break;
}
let fieldName = fields[number];
/**
* If the user didn't define a column list we assume all the model's
* attributes as columns
*/View on GitHub (pinned to b7419de9cd)