0

I'm having problems with this code.

Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number:

I'm making a registration form and I'm using PDO, so I have only 4 rows "usuariorolid, correo, nombre, contraseña", I don't understand where is the mistake on code.

<?php
include_once ("Conexión.php");

$usuariorolid=$_POST["usuariorolid"];
$correo=$_POST["correo"];
$nombre=$_POST["nombre"];
$contraseña=$_POST["contraseña"];

$sentencia=$base_de_datos->prepare("INSERT INTO usuarios(usuariorolid, correo, nombre, contraseña)
VALUES(:usuariorolid,:correo,:nombre,:contraseña)");


$sentencia->bindParam(':usuariorolid',$usuariorolid);
$sentencia->bindParam(':correo',$correo);
$sentencia->bindParam(':nombre',$nombre);
$sentencia->bindParam(':contraseña',$contraseña);


if ($sentencia->execute()){
  return header("Location:Usuario.php");
}
else {
  return "error";
}
?>
Valor_
  • 3,461
  • 9
  • 60
  • 109
  • Does this answer your question? [SQLSTATE\[HY093\]: Invalid parameter number: parameter was not defined](https://stackoverflow.com/questions/10966251/sqlstatehy093-invalid-parameter-number-parameter-was-not-defined) – Nathan Champion Jul 07 '20 at 04:00
  • I found the mistake, the letter ñ doesn't work, disadvantages of being LATAM –  Jul 07 '20 at 04:04

0 Answers0