Currently, my site is set up so you have to delete all the music and then the band if you want both gone. I'd like to make it so that if a band is deleted, all their music is as well. I am using Dreamweaver CS3
To delete the music only I have an unlink:
My delete artist page currently is:PHP Code:if ((isset($_POST['musicID'])) && ($_POST['musicID'] != "")) {
$image_path = '../includes/audio/';
if (isset($_POST['trackdirectory']) && file_exists($image_path.$_POST['trackdirectory'])) {
unlink($image_path.$_POST['trackdirectory']);
}
$deleteSQL = sprintf("DELETE FROM music WHERE musicID=%s",
GetSQLValueString($_POST['musicID'], "int"));
mysql_select_db($database_everyscene, $everyscene);
$Result1 = mysql_query($deleteSQL, $everyscene) or die(mysql_error());
$deleteGoTo = "viewbands.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
PHP Code:if ((isset($_POST['artistID'])) && ($_POST['artistID'] != "")) {
$deleteSQL = sprintf("DELETE FROM artists WHERE artistID=%s",
GetSQLValueString($_POST['artistID'], "int"));
mysql_select_db($database_everyscene, $everyscene);
$Result1 = mysql_query($deleteSQL, $everyscene) or die(mysql_error());
$deleteGoTo = "viewbands.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
Is there a way to add the delete music from a band into the delete a band page? My music table is currently set up as: musicID, track_directory (which links to the server file), artistID (which links to the artist table). Thank you



Reply With Quote

Bookmarks