I am learning PHP on my own and I came across this error ...
(Notice: Undefined index: name in C: \ xampp \ htdocs \ pdo \ save.php on line 3
Notice: Undefined index: last name in C: \ xampp \ htdocs \ pdo \ save.php on line 4
Unexpected failure, the information was not saved)
please help, try to solve it with this ...
$nombre = (isset($_POST['nombre']);
$apellido = (isset($_POST['apellido']);
but I still have problems to later visualize the data of the table that I generated to show this data.
<?php
include 'conexion.php';
$nombre = $_POST['nombre'];
$apellido = $_POST['apellido'];
$ins = $con->prepare("INSERT INTO personas VALUES (DEFAULT, :nombre, :ape) ");
$ins->bindparam(':nombre',$nombre);
$ins->bindparam(':ape',$apellido);
if($ins->execute()){
echo "Guardado con exito";
}else{
echo" Fallo inesperado, no se guardo la información";
}
?>