多くのフィールドを持つPHPフォームがあります。私が望むのは、これらのフィールドの内容に応じて、PostgreSQL テーブルに値を挿入するクエリにフィールドを動的に追加することです。フィールド (date、int など) が空の場合、値が挿入されるのを待っているため、テーブルに INSERT しようとすると「構文エラー」が発生するため、クエリに入れたくありません。助けてください!
編集
INSERT INTO hcd_customermeters ("meterSN", "contractCode",
"deviceManufacturer", "deviceType",
"firstInstallationDate", "diameter",
"pipeID", "operatorCreator", "warehouseDeliveryDate",
"recordCreation", "SRID")
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)'