<?

include '../../config.php';
include '../../func.php';
head();


$id = num($_GET['id']);
$razdel = mysql_fetch_assoc(mysql_query("SELECT * FROM `photo_raz` WHERE `id` = '".$id."'"));

if ( empty($razdel['id']) ) {
    
    echo link2 . 'Раздел не найден' . div;
    navig();
    foot();
    exit();
    
}

$result = mysql_query("DELETE FROM `photo_raz` WHERE `id` = '".$id."'");
mysql_query("DELETE FROM `photo_album` WHERE `cat` = '".$id."'");


    if ( $result != NULL ) {
        
        header('Location: index.php?mod=razdel_delete&result=good');
        
    } else {
        
        header('Location: index.php?mod=razdel_delete&result=error');
        
    }