include("../includes/find/toolbar.html");?>
include("../includes/find/top_right.html");?>
|
To Your Health Newsletter Unsubscribe
1 or $patientcount>1 or ($consumercount>0 and $patientcount>0)){
#More than one record was found. Force the user to select which
#records to delete.
echo "Our records indicate that there is more than one subscriber ";
echo "with an e-mail address of " . $email_addr . ". Please select ";
echo "the records that you wish to have unsubscribed from the To Your ";
echo "Health newsletter. ";
echo "";
}else{
#No validations fired and the subscriber only existed with one row
#in one table, try processing query.
$qname = "DELETE FROM consumers WHERE email_addr = '" .$email_addr . "'";
$result = mysql_query($qname);
if (mysql_affected_rows()>0){
$deletedrows=mysql_affected_rows();
}
$qname = "DELETE FROM patients WHERE email_addr = '" .$email_addr . "'";
$result = mysql_query($qname);
if (mysql_affected_rows()>0){
$deletedrows=mysql_affected_rows();
}
if ($deletedrows>0){
echo "You have successfully unsubscribed from the To Your Health newsletter.";
}
}
mysql_close();
}
} elseif($multiplerecordsubmit){
mysql_connect($hostname);
mysql_select_db($dbname);
if (count($consumerdeletefields)>0){
#Build the sql statement.
$qname = "DELETE FROM consumers WHERE ";
for ($i=0;$i<=count($consumerdeletefields);$i++){
if($consumerdeletefields[$i]<>""){
$qname = $qname . "rec_number=" . $consumerdeletefields[$i] . " or ";
}
}
#strip off the last 'or'
$qname = substr($qname, 0, strlen($qname) - 3);
$result = mysql_query($qname);
}
if (count($patientdeletefields)>0){
#Build the sql statement.
$qname = "DELETE FROM patients WHERE ";
for ($i=0;$i<=count($patientdeletefields);$i++){
if($patientdeletefields[$i]<>""){
$qname = $qname . "rec_number=" . $patientdeletefields[$i] . " or ";
}
}
#strip off the last 'or'
$qname = substr($qname, 0, strlen($qname) - 3);
$result = mysql_query($qname);
}
echo "You have successfully unsubscribed the selected subscibers from the To Your Health newsletter.";
mysql_close();
} else{
?>
Please enter your e-mail address below to unsubscribe from the To Your Health e-mail newsletter.
|
include("../includes/find/prod/musculoskeletal/other1.html");?>
include("../includes/find/prod/musculoskeletal/other2.html");?>
include("../includes/find/prod/musculoskeletal/other3.html");?>
|
|