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_execute($stmt, [ $vars['roll'], $vars['name'], $vars['email'], $vars['city'], $vars['date_of_birth'] ]); } function show_table($dbh) { $result = mysqli_query($dbh, 'SELECT * FROM STUDENT'); html_prologue('Students\' details'); ?>

Students' details

record(s) found.

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

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

record(s) found.

Roll No. Name E-mail City Date of birth
', array_map('htmlspecialchars', [ $row['ROLL'], $row['NAME'], $row['EMAIL'], $row['CITY'], $row['DATE_OF_BIRTH'] ])); ?>

Record of the student

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

'; die(); }