Question
Delete Multiple records
Hey there,
This is the stock code from DMX being a delete record from one table
if ((isset($_GET['recordID'])) && ($_GET['recordID'] != "")) {
$deleteSQL = sprintf("DELETE FROM sitedata WHERE siteid=%s",
GetSQLValueString($_GET['recordID'], "int"));
mysql_select_db($database_bcmain, $bcmain);
$Result1 = mysql_query($deleteSQL, $bcmain) or die(mysql_error());
$deleteGoTo = "index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
but how can i make that delete from 3 tables simultaneously?
the other tables being
$deleteSQL = sprintf("DELETE FROM sitedata WHERE siteid=%s",
GetSQLValueString($_GET['recordID'], "int"));
AND
$deleteSQL = sprintf("DELETE FROM sitecomment WHERE siteid=%s",
GetSQLValueString($_GET['recordID'], "int"));
AND
$deleteSQL = sprintf("DELETE FROM sitetag WHERE siteid=%s",
GetSQLValueString($_GET['recordID'], "int"));
I hope that makes sense
Thanks
This is the stock code from DMX being a delete record from one table
if ((isset($_GET['recordID'])) && ($_GET['recordID'] != "")) {
$deleteSQL = sprintf("DELETE FROM sitedata WHERE siteid=%s",
GetSQLValueString($_GET['recordID'], "int"));
mysql_select_db($database_bcmain, $bcmain);
$Result1 = mysql_query($deleteSQL, $bcmain) or die(mysql_error());
$deleteGoTo = "index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
but how can i make that delete from 3 tables simultaneously?
the other tables being
$deleteSQL = sprintf("DELETE FROM sitedata WHERE siteid=%s",
GetSQLValueString($_GET['recordID'], "int"));
AND
$deleteSQL = sprintf("DELETE FROM sitecomment WHERE siteid=%s",
GetSQLValueString($_GET['recordID'], "int"));
AND
$deleteSQL = sprintf("DELETE FROM sitetag WHERE siteid=%s",
GetSQLValueString($_GET['recordID'], "int"));
I hope that makes sense
Thanks