<?php
    session_start();

    require("../includes/database_connect.php");

    $id = $_GET['id'];
   
    $sql = "delete from tools where id='".$id."'";

    if ($conn->query($sql)) {
        $_SESSION['success'] = "Deleted successfully";
    } else {
        $_SESSION['error'] = "Error updating record: " . $conn->error;
    }
    
    header('location: ../tools_listing.php');
?>