Greetings, I am trying to redirect to the same page after having deleted a record, the page that shows me the table with the data of which I choose to delete this at this address:
/SA/admin/info_student.php?ver_curso_eli=&id_alumno=1
What I want is that by pressing the button of a record, after it is deleted I redirect to the page with that student ID = 1 to continue seeing the data of that student. I will leave the function that deletes the record:
$id = $_GET['id'];
$query = "DELETE FROM inscritos WHERE id = '$id'";
$sql = $mysqli->query($query);
if($sql>0):
header('Location: AQUI ES DONDE DEBERÍA COLOCAR EL ID DE ESE ALUMNO');
else:
echo mysqli_error($mysqli);
endif;
I clarify that the id that I receive with GET in the delete function is not the id of the student, it is the id of the record that I am deleting. Thank you very much to anyone who can help me with this doubt.