$qry11=mysql_query("select * from category where parent_id=0 and status='Y' order by cat_order");
if(mysql_num_rows($qry11)>0){
while($row11=mysql_fetch_array($qry11)){
$qry12=mysql_query("select * from category where parent_id='$row11[cat_id]' and status='Y' order by cat_order");
$pgname=GetValidFileName($row11[cat_name]);
$num12=mysql_num_rows($qry12);
$link35=($num12==0) ? "product_".$pgname."_".$row11[cat_id].".html" : $pgname."_".$row11[cat_id].".html";
?>