<?php
$admin = 2;
$file = __FILE__;
include ("../inc/inc_connect.php");
include ("../inc/inc_admincheck.php");


//find out if it's a main title or a little one...

$result = mysql_query( "SELECT * FROM $grouptable WHERE intId = '$id'" );
$num_rows = mysql_num_rows( $result );
//Dispay records
while ( $a_row = mysql_fetch_object( $result ) )
{
    if ( $a_row->ynGroupMaster == 1)
    {
        $master = "Yes";
        $id = $a_row->intGroupId;
    }
    else
    {
        $master = "No";
    }
}



//Kill! Kill!

if ( $master == "Yes" )
{
    $query = "DELETE FROM $grouptable WHERE intGroupId = '$id'";
}
else
{
    $query = "DELETE FROM $grouptable WHERE intId = '$id'";
}

mysql_query( $query, $link )
or die ( "Could not update in \"$userstable\" table: "
.mysql_error() );
mysql_close( $link);

header("Location: admin_setforums.php");
exit;