<?php
include('db_connection.php');

if (isset($_GET['id'])) {
    $teacher_id = $_GET['id'];

    // Delete teacher record
    $delete_query = "DELETE FROM teachers WHERE teacher_id = ?";
    $stmt = $conn->prepare($delete_query);
    $stmt->bind_param("i", $teacher_id);
    $stmt->execute();
    $stmt->close();

    header('Location: view_teachers.php');
    exit;
}
?>
