<?php
    session_start();

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

    $id = $_GET['id'];
    $type = $_GET['type'];
    $sql2 = "delete from electrical where id='".$id."'";

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