I created a form that is integrated with a payment gateway it is working however I need to check the returned merchant session and returned error code. I want to update the field paystatus which will be the error code value if the returned merchant session is equal to a value stored in column session. This is the code I have but does not seem to be working how I want. Any help is appreciated I am pretty new to php and coding in general.
$merchant = $_GET[‘ms’];//merchant
$status = $_GET[‘ec’];//error code
$query = “SELECT ‘session’ FROM ‘test’ WHERE ‘session’ = '”.$merchant."’";//select merchant session column where merchant variable value is in your table
$result = mysql_query($query); //query
if ($result == $merchant)//if query succeeds and error != 0
{
$sql =“UPDATE $tbl_name SET paystatus=’”.$status."’ WHERE session = ‘".$merchant."’";//update
$doquery = mysql_query($sql);//query
}