Edit file File name : addSpecialProduct.php Content :<?php include("../include/config.php"); include("../include/functions.php"); include("../include/simpleimage.php"); if($_REQUEST['chk']=='true' && $_REQUEST['spcat_id']!='' && $_REQUEST['product_id']!=''){ $prodArr=$obj->query("select id from $tbl_specialcatproduct where spcat_id='".$_REQUEST['spcat_id']."' and prod_id='".$_REQUEST['product_id']."' ",$debug=1); if($obj->numRows($prodArr)==0){ $obj->query("insert into $tbl_specialcatproduct set spcat_id='".$_REQUEST['spcat_id']."', prod_id='".$_REQUEST['product_id']."',status=1 "); } } if($_REQUEST['chk']=='false' && $_REQUEST['spcat_id']!='' && $_REQUEST['product_id']!=''){ //echo "delete from $tbl_specialcatproduct where spcat_id='".$_REQUEST['spcat_id']."' and prod_id='".$_REQUEST['product_id']."' "; $obj->query("delete from $tbl_specialcatproduct where spcat_id='".$_REQUEST['spcat_id']."' and prod_id='".$_REQUEST['product_id']."' "); } echo 1; ?> Save