");
}else{
while($row=mysql_fetch_array($getprods)){
$pIDs[]=$row['ID'];
}//while fetching product IDs
foreach($pIDs as $value){
$pout=mysql_query("DELETE FROM q_products WHERE ID='$value' LIMIT 1");
if(!$pout){
echo("Could not delete Product ID $value. Error: ".mysql_error()."
");
}
}//4each product ID
$popto=mysql_query("OPTIMIZE TABLE q_products");
if(!$popto){
echo("Could not optimize Quote Products. Error: ".mysql_error()."
");
}else{
$gocount=$gocount+1;
}//table optimized
}//gotproducts
$getnotes=mysql_query("SELECT ID FROM q_notes WHERE QID='$QID'");
if(!$getnotes){
echo("Could not verify Quote Notes. Error: ".mysql_error()."
");
}else{
while($row=mysql_fetch_array($getnotes)){
$nIDs[]= $row[0];
}//while getting notes
foreach($nIDs as $value){
$nout=mysql_query("DELETE FROM q_notes WHERE ID='$value' LIMIT 1");
if(!$nout){
echo("Could not delete Note ID $value. Error: ".mysql_error()."
");
}
}//4each note
$popto=mysql_query("OPTIMIZE TABLE q_notes");
if(!$popto){
echo("Could not optimize Quote Notes. Error: ".mysql_error()."
");
}else{
$gocount=$gocount+1;
}//table optimized
}/////got notes
$outship=mysql_query("DELETE FROM q_ship WHERE QID='$QID' LIMIT 1");
if(!$outship){
echo("Could not delete Ship To Record. Error: ".mysql_error()."
");
}else{
$popto=mysql_query("OPTIMIZE TABLE q_ship");
if(!$popto){
echo("Could not optimize Quote Notes. Error: ".mysql_error()."
");
}else{
$gocount=$gocount+1;
}//table optimized
}//outed ship
$outit=mysql_query("DELETE FROM quotes WHERE ID='$QID' and usrn='$usrn' LIMIT 1");
if(!$outit){
echo("Could not delete quote. Error: ".mysql_error()."
");
}else{
$gocount=$gocount+1;
}
if($gocount>3){
header("Location: $relocate");
}
?>