I'm trying to insert two rows to MySQL table using PHP PDO. Below is my code
$bundleParams[] = array(
':bundle_contract_id' => $contract_id,
':bundle_clin' => $clin,
':constituent_clin' => $constituent_clin,
':constituent_quantity' => $constituent_quantity,
':constituent_price' => $constituent_price,
':base_clin' => 'Y'
);
$bundleParams[] = array(
':bundle_contract_id' => $contract_id,
':bundle_clin' => $clin,
':constituent_clin' => 'DELL-COMPONENTS',
':constituent_quantity' => $constituent_quantity,
':constituent_price' => 0.00,
':base_clin' => 'N'
);
$insertSQL = "INSERT INTO product_bundle(bundle_contract_id, bundle_clin, constituent_clin, constituent_quantity, constituent_price, base_clin) VALUES (:bundle_contract_id, :bundle_clin, :constituent_clin, :constituent_quantity, :constituent_price, :base_clin)";
$stmt = $pdo->prepare($insertSQL);
$stmt->execute($bundleParams);
When I execute the code I get the error
Fatal error: Uncaught exception 'PDOException'
with message
SQLSTATE[HY093]: Invalid parameter number
What's wrong with this code?. Can anyone help me track the issue? Thank you very much for your time.