
<?
 if(isset($_GET["id_galeria"])){
        $id_galeria = $_GET["id_galeria"];
        $sql = "select id_foto,url from foto where galeria_id_galeria=$id_galeria ";
        $resultado = $bd->executa_sql($sql);
        while($linhaFoto = mysql_fetch_array($resultado, MYSQL_BOTH)) {
	        $fotoThumb = $linhaFoto["url"];
            unlink("../fotos/$fotoThumb");
            unlink("../fotos/thumb/$fotoThumb");
		}
		$sql  = " delete from foto where galeria_id_galeria=$id_galeria ";		
		$resultado = $bd->executa_sql($sql);        				    
		 
		$sql  = " delete from galeria where id_galeria=$id_galeria ";		
		$resultado = $bd->executa_sql($sql);        				    
		 
		 if (!$resultado)
 			$msg = "<h3>Galeria não excluída...</h3>";
		 else								
			$msg = "<h3>Galeria excluída com sucesso...</h3>";  
 }		    
?>