phalcon/cphalcon · error · Phalcon\Mvc\Model\Query\Exceptions\InsertColumnCountMismatch
The column count does not match the values count
Error message
The column count does not match the values count
What it means
Error "The column count does not match the values count" thrown in phalcon/cphalcon.
Source
Thrown at phalcon/Mvc/Model/Query.zep:1001
if !fetch fields, intermediate["fields"] {
let automaticFields = true,
fields = attributes;
if Settings::get("orm.column_renaming") {
let columnMap = metaData->getColumnMap(model);
} else {
let columnMap = null;
}
}
let values = intermediate["values"];
/**
* The number of calculated values must be equal to the number of fields
* in the model
*/
if unlikely count(fields) != count(values) {
throw new InsertColumnCountMismatch();
}
/**
* Get the dialect to resolve the SQL expressions
*/
let dialect = connection->getDialect();
let insertValues = [];
for number, value in values {
let exprValue = value["value"];
switch value["type"] {
case PHQL_T_STRING:
case PHQL_T_INTEGER:
case PHQL_T_DOUBLE:
let insertValue = dialect->getSqlExpression(exprValue);
break;View on GitHub (pinned to b7419de9cd)
When it happens
Trigger: Thrown at phalcon/Mvc/Model/Query.zep:1001 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/f1def237cbc6b5b0.
Report an issue: GitHub.