My ISP reported that one of my tables didn't close properly "
client is using or hasn't closed the table properly". We have used the same scrip (queries) for some time.
Does anyone see a problem with this script?
if ($txn_type == "cart"){
$strQuery = "insert into paypal_payment_info(paymentstatus,buyer_email,firs tname,lastname,street,city,state,zipcode,country,m c_gross,mc_fee,memo,paymenttype,paymentdate,txnid, pendingreason,reasoncode,tax,datecreation) values ('".$payment_status."','".$payer_email."','".$firs t_name."','".$last_name."','".$address_street."',' ".$address_city."','".$address_state."','".$addres s_zip."','".$address_country."','".$mc_gross."','" .$mc_fee."','".$memo."','".$payment_type."','".$pa yment_date."','".$txn_id."','".$pending_reason."', '".$reason_code."','".$tax."','".$fecha."')";
$result = mysql_query($strQuery) or die("Cart - paypal_payment_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
for ($i = 1; $i <= $num_cart_items; $i++) {
$itemname = "item_name".$i;
$itemnumber = "item_number".$i;
$on0 = "option_name1_".$i;
$os0 = "option_selection1_".$i;
$on1 = "option_name2_".$i;
$os1 = "option_selection2_".$i;
$quantity = "quantity".$i;
$struery = "insert into paypal_cart_info(txnid,itemnumber,itemname,os0,on0 ,os1,on1,quantity,invoice,custom) values ('".$txn_id."','".$_POST[$itemnumber]."','".$_POST[$itemname]."','".$_POST[$on0]."','".$_POST[$os0]."','".$_POST[$on1]."','".$_POST[$os1]."','".$_POST[$quantity]."','".$invoice."','".$custom."')";
$result = mysql_query($struery) or die("Cart - paypal_cart_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
$strQuery2 = "UPDATE BSAP SET payAMT_bsa='".$mc_gross."', regPayDate_bsa='".$payment_date."' WHERE id_bsa='".$custom."'";
$result = mysql_query($strQuery2) or die("Subscription - paypal_subscription_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
}
}
else{
$strQuery = "insert into paypal_payment_info(paymentstatus,buyer_email,firs tname,lastname,street,city,state,zipcode,country,m c_gross,mc_fee,itemnumber,itemname,os0,on0,os1,on1 ,quantity,memo,paymenttype,paymentdate,txnid,pendi ngreason,reasoncode,tax,datecreation,custom) values ('".$payment_status."','".$payer_email."','".$firs t_name."','".$last_name."','".$address_street."',' ".$address_city."','".$address_state."','".$addres s_zip."','".$address_country."','".$mc_gross."','" .$mc_fee."','".$item_number."','".$item_name."','" .$option_name1."','".$option_selection1."','".$opt ion_name2."','".$option_selection2."','".$quantity ."','".$memo."','".$payment_type."','".$payment_da te."','".$txn_id."','".$pending_reason."','".$reas on_code."','".$tax."','".$fecha."','".$custom."')" ;
$result = mysql_query("insert into paypal_payment_info(paymentstatus,buyer_email,firs tname,lastname,street,city,state,zipcode,country,m c_gross,mc_fee,itemnumber,itemname,os0,on0,os1,on1 ,quantity,memo,paymenttype,paymentdate,txnid,pendi ngreason,reasoncode,tax,datecreation,custom) values ('".$payment_status."','".$payer_email."','".$firs t_name."','".$last_name."','".$address_street."',' ".$address_city."','".$address_state."','".$addres s_zip."','".$address_country."','".$mc_gross."','" .$mc_fee."','".$item_number."','".$item_name."','" .$option_name1."','".$option_selection1."','".$opt ion_name2."','".$option_selection2."','".$quantity ."','".$memo."','".$payment_type."','".$payment_da te."','".$txn_id."','".$pending_reason."','".$reas on_code."','".$tax."','".$fecha."','".$custom."')" ) or die("Default - paypal_payment_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
}
// send an email in any case
echo "Verified";
mail($notify_email, "VERIFIED IPN", "$res\n $req\n $strQuery\n $struery\n $strQuery2");
$strQuery2 = "UPDATE BSAP SET payAMT_bsa='".$mc_gross."', regPayDate_bsa='".$payment_date."' WHERE id_bsa='".$custom."'";
$result = mysql_query($strQuery2) or die("Subscription - paypal_subscription_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
mail($notify_email, "VERIFIED IPN", "$res\n $req\n $strQuery\n $struery\n $strQuery2");
}
else {
// send an email
mail($notify_email, "VERIFIED DUPLICATED TRANSACTION", "$res\n $req \n $strQuery\n $struery\n $strQuery2");
}
//subscription handling branch
if ( $txn_type == "subscr_signup" || $txn_type == "subscr_payment" ) {
// insert subscriber payment info into paypal_payment_info table
$strQuery = "insert into paypal_payment_info(paymentstatus,buyer_email,firs tname,lastname,street,city,state,zipcode,country,m c_gross,mc_fee,memo,paymenttype,paymentdate,txnid, pendingreason,reasoncode,tax,datecreation,custom) values ('".$payment_status."','".$payer_email."','".$firs t_name."','".$last_name."','".$address_street."',' ".$address_city."','".$address_state."','".$addres s_zip."','".$address_country."','".$mc_gross."','" .$mc_fee."','".$memo."','".$payment_type."','".$pa yment_date."','".$txn_id."','".$pending_reason."', '".$reason_code."','".$tax."','".$fecha."','".$cus tom."')";
$result = mysql_query($strQuery) or die("Subscription - paypal_payment_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
// insert subscriber info into paypal_subscription_info table
$strQuery2 = "UPDATE BSAP SET payAMT_bsa='".$mc_gross."', regPayDate_bsa='".$payment_date."' WHERE id_bsa='".$custom."'";
$result = mysql_query($strQuery2) or die("Subscription - paypal_subscription_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
mail($notify_email, "VERIFIED IPN", "$res\n $req\n $strQuery\n $struery\n $strQuery2");
client is using or hasn't closed the table properly". We have used the same scrip (queries) for some time.
Does anyone see a problem with this script?
if ($txn_type == "cart"){
$strQuery = "insert into paypal_payment_info(paymentstatus,buyer_email,firs tname,lastname,street,city,state,zipcode,country,m c_gross,mc_fee,memo,paymenttype,paymentdate,txnid, pendingreason,reasoncode,tax,datecreation) values ('".$payment_status."','".$payer_email."','".$firs t_name."','".$last_name."','".$address_street."',' ".$address_city."','".$address_state."','".$addres s_zip."','".$address_country."','".$mc_gross."','" .$mc_fee."','".$memo."','".$payment_type."','".$pa yment_date."','".$txn_id."','".$pending_reason."', '".$reason_code."','".$tax."','".$fecha."')";
$result = mysql_query($strQuery) or die("Cart - paypal_payment_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
for ($i = 1; $i <= $num_cart_items; $i++) {
$itemname = "item_name".$i;
$itemnumber = "item_number".$i;
$on0 = "option_name1_".$i;
$os0 = "option_selection1_".$i;
$on1 = "option_name2_".$i;
$os1 = "option_selection2_".$i;
$quantity = "quantity".$i;
$struery = "insert into paypal_cart_info(txnid,itemnumber,itemname,os0,on0 ,os1,on1,quantity,invoice,custom) values ('".$txn_id."','".$_POST[$itemnumber]."','".$_POST[$itemname]."','".$_POST[$on0]."','".$_POST[$os0]."','".$_POST[$on1]."','".$_POST[$os1]."','".$_POST[$quantity]."','".$invoice."','".$custom."')";
$result = mysql_query($struery) or die("Cart - paypal_cart_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
$strQuery2 = "UPDATE BSAP SET payAMT_bsa='".$mc_gross."', regPayDate_bsa='".$payment_date."' WHERE id_bsa='".$custom."'";
$result = mysql_query($strQuery2) or die("Subscription - paypal_subscription_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
}
}
else{
$strQuery = "insert into paypal_payment_info(paymentstatus,buyer_email,firs tname,lastname,street,city,state,zipcode,country,m c_gross,mc_fee,itemnumber,itemname,os0,on0,os1,on1 ,quantity,memo,paymenttype,paymentdate,txnid,pendi ngreason,reasoncode,tax,datecreation,custom) values ('".$payment_status."','".$payer_email."','".$firs t_name."','".$last_name."','".$address_street."',' ".$address_city."','".$address_state."','".$addres s_zip."','".$address_country."','".$mc_gross."','" .$mc_fee."','".$item_number."','".$item_name."','" .$option_name1."','".$option_selection1."','".$opt ion_name2."','".$option_selection2."','".$quantity ."','".$memo."','".$payment_type."','".$payment_da te."','".$txn_id."','".$pending_reason."','".$reas on_code."','".$tax."','".$fecha."','".$custom."')" ;
$result = mysql_query("insert into paypal_payment_info(paymentstatus,buyer_email,firs tname,lastname,street,city,state,zipcode,country,m c_gross,mc_fee,itemnumber,itemname,os0,on0,os1,on1 ,quantity,memo,paymenttype,paymentdate,txnid,pendi ngreason,reasoncode,tax,datecreation,custom) values ('".$payment_status."','".$payer_email."','".$firs t_name."','".$last_name."','".$address_street."',' ".$address_city."','".$address_state."','".$addres s_zip."','".$address_country."','".$mc_gross."','" .$mc_fee."','".$item_number."','".$item_name."','" .$option_name1."','".$option_selection1."','".$opt ion_name2."','".$option_selection2."','".$quantity ."','".$memo."','".$payment_type."','".$payment_da te."','".$txn_id."','".$pending_reason."','".$reas on_code."','".$tax."','".$fecha."','".$custom."')" ) or die("Default - paypal_payment_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
}
// send an email in any case
echo "Verified";
mail($notify_email, "VERIFIED IPN", "$res\n $req\n $strQuery\n $struery\n $strQuery2");
$strQuery2 = "UPDATE BSAP SET payAMT_bsa='".$mc_gross."', regPayDate_bsa='".$payment_date."' WHERE id_bsa='".$custom."'";
$result = mysql_query($strQuery2) or die("Subscription - paypal_subscription_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
mail($notify_email, "VERIFIED IPN", "$res\n $req\n $strQuery\n $struery\n $strQuery2");
}
else {
// send an email
mail($notify_email, "VERIFIED DUPLICATED TRANSACTION", "$res\n $req \n $strQuery\n $struery\n $strQuery2");
}
//subscription handling branch
if ( $txn_type == "subscr_signup" || $txn_type == "subscr_payment" ) {
// insert subscriber payment info into paypal_payment_info table
$strQuery = "insert into paypal_payment_info(paymentstatus,buyer_email,firs tname,lastname,street,city,state,zipcode,country,m c_gross,mc_fee,memo,paymenttype,paymentdate,txnid, pendingreason,reasoncode,tax,datecreation,custom) values ('".$payment_status."','".$payer_email."','".$firs t_name."','".$last_name."','".$address_street."',' ".$address_city."','".$address_state."','".$addres s_zip."','".$address_country."','".$mc_gross."','" .$mc_fee."','".$memo."','".$payment_type."','".$pa yment_date."','".$txn_id."','".$pending_reason."', '".$reason_code."','".$tax."','".$fecha."','".$cus tom."')";
$result = mysql_query($strQuery) or die("Subscription - paypal_payment_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
// insert subscriber info into paypal_subscription_info table
$strQuery2 = "UPDATE BSAP SET payAMT_bsa='".$mc_gross."', regPayDate_bsa='".$payment_date."' WHERE id_bsa='".$custom."'";
$result = mysql_query($strQuery2) or die("Subscription - paypal_subscription_info, Query failed:<br>" . mysql_error() . "<br>" . mysql_errno());
mail($notify_email, "VERIFIED IPN", "$res\n $req\n $strQuery\n $struery\n $strQuery2");