error("That alias is the last alias for that artist, removing it would cause bad things to happen.");
}
$DB->query("SELECT GroupID FROM torrents_artists WHERE AliasID='$AliasID'");
if($DB->record_count()>0){
list($GroupID)=$DB->next_record();
if($GroupID!=0){
error("That alias still has the group ($GroupID) attached, fix that first.");
}
}
$DB->query("SELECT aa.ArtistID, ag.Name, aa.Name FROM artists_alias AS aa JOIN artists_group AS ag ON aa.ArtistID=ag.ArtistID WHERE aa.AliasID=".$AliasID);
write_log("The alias ".$AliasID." (".$AliasName.") was removed from the artist ".$ArtistID." (".$ArtistName.") by user ".$LoggedUser['ID']." (".$LoggedUser['Username'].")");