No puedo ingresar datos a mi bd por este error:
Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in C:\xampp\htdocs\G6-Proyecto\crudclientes.php:21 Stack trace: #0 C:\xampp\htdocs\G6-Proyecto\crudclientes.php(21): PDOStatement->execute() #1 {main} thrown in C:\xampp\htdocs\G6-Proyecto\crudclientes.php on line 21
<?php include("template/cabecera-crud.php")?>
<?php
$txtid=(isset($_POST['txtid']))?$_POST['txtid']:"";
$txtnombres=(isset($_POST['txtnombres']))?$_POST['txtnombres']:"";
$txtapellidos=(isset($_POST['txtapellidos']))?$_POST['txtapellidos']:"";
$txtcorreo=(isset($_POST['txtcorreo']))?$_POST['txtcorreo']:"";
$txtpass=(isset($_POST['txtpass']))?$_POST['txtpass']:"";
$accion=(isset($_POST['accion']))?$_POST['accion']:"";
include("config/bd.php");
switch($accion){
case "Agregar":
$sentenciaSQL=$conexion->prepare("INSERT INTO clientes (id, nombres, apellidos, correo, contraseña) VALUES (:id, :nombres, :apellidos, :correo, :contraseña);");
$sentenciaSQL->bindParam(':id',$txtid);
$sentenciaSQL->bindParam(':nombres',$txtnombres);
$sentenciaSQL->bindParam(':apellidos',$txtapellidos);
$sentenciaSQL->bindParam(':correo',$txtcorreo);
$sentenciaSQL->bindParam(':contraseña',$txtpass);
$sentenciaSQL->execute();
echo "Presionando el boton Agregar";
break;