<?php
require('conexion.php');

$selecbann=$_POST['selecbann'];

$result_img=mysqli_query($link,"select categ_excursion FROM excursion_web WHERE id_excursion='".$selecbann."'"); 
$resultadoimg=mysqli_fetch_array($result_img);
$categ_excursion=$resultadoimg['categ_excursion'];


//unlink($img_excursion);
$result=mysqli_query($link,"select url_excimg FROM excursion_img WHERE id_excursion='".$selecbann."'"); 
while($resultado=mysqli_fetch_array($result)){
$url_excimg=$resultado['url_excimg'];
unlink($url_excimg);
}

$result=mysqli_query($link,"delete from excursion_img where categ_excursion='".$categ_excursion."'");
$result=mysqli_query($link,"delete from excursion_web where id_excursion='$selecbann'");
echo "<font style='background-color:#FF0000; color:#000; font-family:Arial Black; font-size:10px; color:#FFF'>BORRADO CON EXITO.</font>";
?>
