i have this code
switch ($var1) {
case 'corredor':{
$query = ' UPDATE corredor
SET
cedula = :cedula,
nombres = :nombres,
apellidos = :apellidos,
fechanacimiento = :fechanacimiento,
telefono = :telefono,
correo = :correo,
direccion = :direccion,
fecharegistro = :fecharegistro,
estatus = :estatus,
aseguradora_rif =: aseguradora_rif
WHERE cedula = :cedula_old
';
$query_params = array(
':cedula' => $_POST['cedula'],
':nombres' => $_POST['nombres'],
':apellidos' => $_POST['apellidos'],
':fechanacimiento' => $_POST['fechanacimiento'],
':telefono' => $_POST['telefono'],
':correo' => $_POST['correo'],
':direccion' => $_POST['direccion'],
':fecharegistro' => $_POST['fecharegistro'],
':estatus' => $_POST['estatus'],
':aseguradora_rif' => $_POST['aseguradora_rif']
':cedula_old' => $var2
);
try {
$stmt = $db->prepare($query);
$result = $stmt->execute($query_params);
} catch (PDOException $ex) {
$ex->getMessage();
}
#header('Location: index.php?do=listacorredor');
break;
} //fin case
i'm getting
SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
and i don't know why, all my parameters seems to match, i already looked for extra , at the end of the query and params all the binds match the database names so i'm lost here, the other answers were things like missing , or something like that but really can't see the problem here.