Snowhawk Posted April 4, 2009 Share Posted April 4, 2009 Grrr! Sorry! I get easily frustrated in my old age! I can't seem to get the 3rd subcategory to show. I have this: Real Estate Rentals Comercial Residential Sales Rentals shows up but Comercial & Residential doesn't. Here is the script: <? include('header.php'); //Print bread crumb echo "You are here: <a href='index.php'>Home</a> » <a href='view_all.php'>All Categories</a>"; echo "<h4>All Categories</h4>"; echo "<h5><center>If you need a category made contact Webmaster.</h5></center>"; //Fetch all Father categories order by title asc $node = new sqlNode(); $node->table = "categories"; $node->select = "*"; $node->where = "where FatherID = 0"; $node->orderby="order by Title asc"; if( ($result = $mysql->select($node)) === false ) die($mysql->debugPrint()); $num_of_rows = mysql_num_rows($result); echo "<table border=0 align=center cellpadding=2 width=98%>"; echo "<tr>"; echo "<td valign=top>"; $count = 0; $break = ceil($num_of_rows/2); while( $category = mysql_fetch_assoc($result) ){ echo "<p>"; echo "<a href='browse.php?fatherID=".$category['ID']."'>".$category['Title']; if($settings['ShowNumAds'] == 'yes'){ $number_of_ads = fetchNumAds(intval($category['ID']),$mysql) + fetchSubCats(intval($category['ID']),$mysql); if( ($number_of_ads > 0) || ($settings['ShowGTZero'] == 'yes') ) echo " (" . $number_of_ads . ")"; } echo "</a><br/>"; $node = new sqlNode(); $node->table = "categories"; $node->select = "*"; $node->where = "where FatherID = ".intval($category['ID']); $node->orderby="order by Title asc"; if( ($subRS = $mysql->select($node)) === false ) die($mysql->debugPrint()); $num_subcats = mysql_num_rows($subRS); $break2 = ceil($num_subcats/2); $count2 = 1; echo "<table border=0>"; echo "<tr>"; echo "<td valign=top>"; while( $subcat = mysql_fetch_assoc($subRS) ){ echo "<table border=0 cellspacing=0 sellpadding=0>"; echo "<tr>"; echo "<td>"; echo "<a href='browse.php?fatherID=".$subcat['ID']."' title='".$subcat['Title']."'>"; echo "<img src='icons_folder/folder.jpg' border=0 alt='".$subcat['Title']."' >"; echo "</a>"; echo "</td>"; echo "<td>"; echo "<span class='subCat'><a href='browse.php?fatherID=".$subcat['ID']."'>".$subcat['Title']."</a>"; if($settings['ShowNumAds'] == 'yes'){ $number_of_ads = fetchNumAds(intval($subcat['ID']),$mysql) + fetchSubCats(intval($subcat['ID']),$mysql); if( ($number_of_ads > 0) || ($settings['ShowGTZero'] == 'yes') ) echo " (" . $number_of_ads . ")"; } echo "</span>"; echo "</td>"; echo "</tr>"; echo "</table>"; if($count2 == $break2){ echo "</td><td valign=top>"; } $count2++; } echo "</td>"; echo "</tr>"; echo "</table>"; } echo "</td>"; echo "</tr>"; echo "</table>"; include('footer.php'); ?> Thank you in advance for your expertise in this field. Quote Link to comment https://forums.phpfreaks.com/topic/152541-3rd-subcategories-dont-want-to-come-up/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.