Menu of operations on records of students

Enter E-mail address to search for the record of a student

Enter student's details

Insertion successful.

Operation failed

Reason:

$desc) { if (!isset($_POST[$name]) || empty($_POST[$name])) display_failure('The ' . $desc . ' field can not be empty'); $vars[$name] = $_POST[$name]; } return $vars; } function insert_details($dbh) { $vars = check_post_vars([ 'name' => 'Name', 'email' => 'E-mail address', 'date_of_birth' => 'Date of birth', 'city' => 'City', 'roll' => 'Roll No.' ]); $stmt = mysqli_prepare($dbh, 'INSERT INTO STUDENT (ROLL, NAME, EMAIL, CITY, DATE_OF_BIRTH) VALUES (?,?,?,?,?)'); mysqli_stmt_bind_param($stmt, 'sssss', $vars['roll'], $vars['name'], $vars['email'], $vars['city'], $vars['date_of_birth']); mysqli_stmt_execute($stmt); } function show_table($result) { ?>
Roll No. Name E-mail City Date of birth
', array_map('htmlspecialchars', [$row['ROLL'], $row['NAME'], $row['EMAIL'], $row['CITY'], $row['DATE_OF_BIRTH']])); ?>

Students' details

record(s) found.

Students' details

The students who were born in years 2000 to 2005, inclusive.

record(s) found.

Record of the student

Roll No.
Name
E-mail
City
Date of birth
Path ' . htmlspecialchars($path) . ' was not found.

'; die(); }