<?

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


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

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

$result = mysql_query("DELETE FROM `forum_podrazdel` WHERE `id` = '".$id."'");
mysql_query("DELETE FROM `forum_themes` WHERE `razdel_id` = '".$id."'");
mysql_query("DELETE FROM `forum_msg` WHERE `razdel_id` = '".$id."'");

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