query($SQL_Category); while ($objResult_Category = mysqli_fetch_array($objQuery_Category)) { $ProductCategory2Name = $objResult_Category["ProductCategory2_Name"]; $ProductCategory2ID = $objResult_Category["ProductCategory2_ID"]; $SQL_Category3 = " SELECT product_category3.ProductCategory3_ID , product_category3.ProductCategory3_Name , product_category3.ProductCategory3_Sort, product_category3.StatusProductCategory3_ID , product_category3.ProductCategory2_ID FROM product_category3 WHERE product_category3.StatusProductCategory3_ID = 1 AND product_category3.ProductCategory2_ID = $ProductCategory2ID ORDER BY product_category3.ProductCategory3_Sort "; $objQuery_Category3 = $objConnect->query($SQL_Category3); while ($objResult_Category3 = mysqli_fetch_array($objQuery_Category3)) { $ProductCategory3ID2 = $objResult_Category3["ProductCategory3_ID"]; } if($ProductCategory2ID == 198){ $LinkHref = 'product_category3.php?c3='.$ProductCategory3ID2.''; }else if ($ProductCategory2ID == 193) { $LinkHref = 'product_category3.php?c3='.$ProductCategory3ID2.''; } else{ $LinkHref = 'product_category.php?c2='.$ProductCategory2ID.''; } ?>