0) { while($res2 = mysqli_fetch_array($result2)) { $maincat = $res2['MainCategoryID']; $subcat = $res2['MainSubCategoryID']; } } }else{ $productid = $_REQUEST['productid']; $maincat = $_REQUEST['maincat']; $subcat = $_REQUEST['subcat']; } if(isset($_REQUEST['maincat'])) { $query = "select * from tblproductmaincategories where ID=$maincat"; }else{ $query = "select * from tblproductmaincategories limit 1"; } //echo $query; $result = mysqli_query($con,$query); $count = mysqli_affected_rows($con); if($count > 0) { while($res = mysqli_fetch_array($result)) { $maincatname = $res['MainCategoryName']; } } ?>

Products


    0) { while($res2 = mysqli_fetch_array($result2)) { $maincat1 = $res2['MainCategoryID']; $subcat1 = $res2['MainSubCategoryID']; } } }else{ $productid1 = $_REQUEST['productid']; $maincat1 = $_REQUEST['maincat']; $subcat1 = $_REQUEST['subcat']; } $query11 = "select * from tblproductmaincategories order by MainCategoryName ASC"; // echo $query; $result11 = mysqli_query($con,$query11); $count = mysqli_affected_rows($con); if($count > 0) { ?>
  • >
0) { while($res2 = mysqli_fetch_array($result2)) { $maincat = $res2['MainCategoryID']; $subcat = $res2['MainSubCategoryID']; $productid = $res2['ID']; } } }else{ $productid = $_REQUEST['productid']; $maincat = $_REQUEST['maincat']; $subcat = $_REQUEST['subcat']; } if(!isset($_REQUEST['maincat']) and !isset($_REQUEST['subcat']) and !isset($_REQUEST['productid'])){ $query = "select * from tblproducts order by MainSubCategoryID asc limit 1"; }else if(!isset($_REQUEST['subcat']) and !isset($_REQUEST['productid'])){ $query = "select * from tblproducts where MainCategoryID=$maincat order by ProductName asc limit 1"; }else if(!isset($_REQUEST['productid'])) { $query = "select * from tblproducts where MainSubCategoryID=$subcat and MainSubCategoryID=$subcat order by ProductName asc limit 1"; }else{ $query = "select * from tblproducts where MainCategoryID=$maincat and MainSubCategoryID=$subcat and ID=$productid limit 1"; } //echo $query; $result = mysqli_query($con,$query); $count = mysqli_affected_rows($con); if($count > 0) { while($res = mysqli_fetch_array($result)) { $productid = $res['ID']; } } $query = "select * from tblproducts where ID=$productid"; //echo $query; $result = mysqli_query($con,$query); $count = mysqli_affected_rows($con); if($count > 0) { ?>

0) { while($res2 = mysqli_fetch_array($result2)) { $maincat1 = $res2['MainCategoryID']; $subcat1 = $res2['MainSubCategoryID']; } } }else{ $productid1 = $_REQUEST['productid']; $maincat1 = $_REQUEST['maincat']; $subcat1 = $_REQUEST['subcat']; } /* $productid1 = $_REQUEST['productid']; $maincat1 = $_REQUEST['maincat']; $subcat1 = $_REQUEST['subcat'];*/ if(isset($_REQUEST['subcat'])) { $subcat1 = $_REQUEST['subcat']; }else{ $query = "select * from tblproductmainsubcategories where MainCategoryID=$maincat order by ID asc limit 1"; $result = mysqli_query($con,$query); $count = mysqli_affected_rows($con); while($res = @mysqli_fetch_array($result)) { $subcat1 = $res['ID']; } } if(!isset($subcat1) and !isset($maincat1)){ $query = "select * from tblproducts order by ProductName asc "; }else if(!isset($subcat1)){ $query = "select * from tblproducts where MainCategoryID=$maincat1 order by ProductName asc "; }else{ $query = "select * from tblproducts where MainCategoryID=$maincat1 and MainSubCategoryID=$subcat1 order by ProductName asc "; } //$query = "select * from tblproducts where MainCategoryID=$maincat and MainSubCategoryID=$subcat"; // echo $query; $result = mysqli_query($con,$query); $count = mysqli_affected_rows($con); $k = 0; ?>
    0) { ?>
  • >
  • >
  • >