So remove the if
<!--show if -->
<?php if (($rsSubCategories->getColumnVal("SubcategoryCategoryID") == ($rsCategories->getColumnVal("CategoryID")))) { // Show if sub category exists ?>
<?php } // Show if sub category exists ?>
<!--end show if -->
and paste it there?