<?php
try {
if (isset($_POST['add']))
{
$n = $_POST['name_t'];
$d = $_POST['day_t'];
$insertorder = mysqli_query($conn, "INSERT into teachers values (default, '$n', '$d')");
if ($insertorder)
{
header("location: index.php");
}
}
}
catch (Exception $e)
{
echo "Error";
}
?>