<?

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


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

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

$result = mysql_query("DELETE FROM `clans` WHERE `id` = '".$id."'");
mysql_query("DELETE FROM `clans_user` WHERE `clan` = '".$id."'");


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