Reason:
$desc) { if (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 | City | Date of birth | |
---|---|---|---|---|
', array_map('htmlspecialchars', [$row['ROLL'], $row['NAME'], $row['EMAIL'], $row['CITY'], $row['DATE_OF_BIRTH']])); ?> |
record(s) found.
The students who were born in years 2000 to 2005, inclusive.
record(s) found.
Roll No. | |
---|---|
Name | |
City | |
Date of birth |
' . htmlspecialchars($path) . '
was not found.';
die();
}