name : del_team.php
<?php
include('../config/config.php');


$q = $_POST['q'];

$sql = "SELECT * FROM teams WHERE t_id = ".$q." ";
$res = $conn->query($sql);
while($row = $res->fetch_assoc()){
    $image = $row['t_image'];
    @unlink("../".$image);
}

$sql = "DELETE FROM teams WHERE t_id = ".$q." ";
$res = $conn->query($sql);
if($res === TRUE){
   
    echo 1;
}else{
    echo 0;
}

?>

© 2024 UnknownSec