Php PSQL-INSERT的表达式比目标列多

Php PSQL-INSERT的表达式比目标列多,php,postgresql,pdo,psql,Php,Postgresql,Pdo,Psql,当我尝试向我的PSQL DB插入某些内容时,会出现以下错误: SQLSTATE[42601]:语法错误:7错误:INSERT有更多表达式 超过目标列第1行:…制造商、模型、子模型)值($1, $2、$3、$4、$4、$5、$6)^ 我的查询显示在下面,为了避免数据问题,我只插入数字字符串。这对我来说真的很有意思 查询: public function insertToPsql($manufacturer_code, $main_type, $subtype_code, $manufacturer

当我尝试向我的PSQL DB插入某些内容时,会出现以下错误:

SQLSTATE[42601]:语法错误:7错误:INSERT有更多表达式 超过目标列第1行:…制造商、模型、子模型)值($1, $2、$3、$4、$4、$5、$6)^

我的查询显示在下面,为了避免数据问题,我只插入数字字符串。这对我来说真的很有意思

查询:

public function insertToPsql($manufacturer_code, $main_type, $subtype_code, $manufacturer, $model, $submodel)
{
    try {
        //$con = new PDO( PSQL_DB_HOST, PSQL_DB_HOST, PSQL_DB_HOST );
        $con = new PDO("pgsql:dbname=audahistory;host=localhost", "postgres", "");
        $con->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
        $sql = "INSERT INTO car_type(manufacturer_code, main_type, subtype_code, manufacturer, model, submodel) VALUES(:manufacturer_code, :main_type, :subtype_code, :manufacturer, :model, :submodel)";
        $stmt = $con->prepare( $sql );
        $stmt->bindValue( 'manufacturer_code', "1", PDO::PARAM_STR );
        $stmt->bindValue( 'main_type', "2", PDO::PARAM_STR );
        $stmt->bindValue( 'subtype_code', "3", PDO::PARAM_STR );
        $stmt->bindValue( 'manufacturer', "4", PDO::PARAM_STR );
        $stmt->bindValue( 'model', "5", PDO::PARAM_STR );
        $stmt->bindValue( 'submodel', "6", PDO::PARAM_STR );
        $stmt->execute();
    }
    catch( PDOException $e ) {
        echo $e->getMessage();
        exit;
    }
}
知道cna在哪里是个问题吗?
感谢您在“插入SQL”行中提供的建议,您已经:列出了两次制造商。谢谢@p.Gearman我更改了,但问题似乎仍然存在:(我还尝试了一些非常简单的终端操作,将在几分钟内添加edit来显示您的
DB
表。@Andurit这不重要,但我注意到您正在以字符串形式插入数字。这些值只是占位符吗?另外,您正在声明提交的数据类型,它们是否与列的数据类型匹配?我们可以获取您的表吗要交叉引用的结构。
$4
..$3、$4、$4、$5…
中有两次。这似乎不是来自问题中显示的查询。