<?php 

include("db_connection.php");
$Mainclass=new DB_Controller();

$flag = $Mainclass->real_escapes($_REQUEST['flag']);
$per = $Mainclass->real_escapes($_REQUEST['per']);
$collection_id = $Mainclass->real_escapes($_REQUEST['collection_id']);

if($flag=="Add"){
    
  $collection_id = $collection_id;  
}

if($flag=="Delete"){
    
  $collection_id = "";  
}


$update_sql=$Mainclass->dbh->prepare("UPDATE gold_products_master  SET collection_id=?  WHERE SLN=?");
$update_sql->bind_param('ss',$collection_id,$per);
$update_sql->execute();
$update_sql->close();

?>