I'm trying to delete information from multiple tables (and using Dreamweaver, so the code is a little crazy).
I'm getting this error:
Parse error: parse error, unexpected T_STRING in /home/citijoh2/public_html/Management/phyDirDelete.php on line 31
Line 31 is the end of my DELETE statement: GetSQLValueString($_GET['phyDirNo'], "int"));
Any suggestions? Did I miss something else? Thanks!
Here's my code:
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
if ((isset($GET['phyDirNo'])) && ($GET['phyDirNo'] != "")) {
$deleteSQL = sprintf("SELECT * FROM physicianDir, phyDirDoctorSpecial WHERE phyDirDoctorSpecial.physicianID = physicianDir.phyDirNo; DELETE FROM physicianDir WHERE phyDirNo=%s; DELETE FROM phyDirDoctorSpecial WHERE physicianID=%s ",
GetSQLValueString($GET['phyDirNo'], "int")
GetSQLValueString($GET['phyDirNo'], "int"));
mysql_select_db($database_connCitizens, $connCitizens);
$Result1 = mysql_query($deleteSQL, $connCitizens) or die(mysql_error());
$deleteGoTo = "phyDirHome.php";
if (isset($SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}