spidermonster Posted March 31, 2007 Share Posted March 31, 2007 I am trying to make something like breadcrumbs, but using the categories out of my mysql database. here is the code I have: <?php $query = "SELECT * FROM class_categories"; $result = mysql_query($query); $numrows = mysql_num_rows($result); echo '<a href="http://'.$domain.'/c/index.php"><font size="2">Main Categories</a> : '; while($r1 = mysql_fetch_array($result)){ if($r1['id']==$sub){ echo '<a href="http://'.$domain.'/c/results.php?id='.$sub.'&main='.$main.'"><font size="2">'.$r1['cat'].'</a> : '; } if($r1['id']==$id){ echo $r1['cat'].''; } } ?> This actually displays each category that is clicked on... if one category is clicked, it shows something like the below text: Main Categories : Antiques & Collectibles Now if a subcategory is clicked under Antiques & Collectibles like Dolls, it shows something like the below text: Main Categories : Antiques & Collectibles : Dolls What my problem is, I was wanting to make it better,,, kinda like if I add another subcategory under Dolls, for what type of dolls, it would have something like below: Main Categories : Antiques & Collectibles : Dolls : Rag Or Like: Main Categories : Antiques & Collectibles : Dolls : Porcelain I wanted to use it as a navigation system with my other categories so that its easier for people to view items in classifieds and just be able to click a link from this Categories Breadcrumbs style link system to go back to whatever category they were at before they reach the area that they might be at... I think I made that sound more confusing than it should be,,, I just want to be able to have the categories at the top of the page in a breadbrumbs style, but for unlimited breadcrumbs,, this one only shows 2 of the subcategories in depth. main link to home page : then parent category link : then subcategory1 link when I want : home page link : parent category link : subcategory link : sub-subcategory link : sub-sub-subcategory link : and so on............................ Link to comment https://forums.phpfreaks.com/topic/45072-category-breadcrumbs/ Share on other sites More sharing options...
spidermonster Posted April 4, 2007 Author Share Posted April 4, 2007 Help on this would be appreciated, or another way I can do a breadcrumbs Link to comment https://forums.phpfreaks.com/topic/45072-category-breadcrumbs/#findComment-221292 Share on other sites More sharing options...
Asheh Posted April 4, 2007 Share Posted April 4, 2007 Just check what category your in and its subcategorys and display that? Link to comment https://forums.phpfreaks.com/topic/45072-category-breadcrumbs/#findComment-221299 Share on other sites More sharing options...
spidermonster Posted April 6, 2007 Author Share Posted April 6, 2007 Hey, you know, thats an idea... cuz i can include that with my descriptions also...thanks Asheh Link to comment https://forums.phpfreaks.com/topic/45072-category-breadcrumbs/#findComment-222662 Share on other sites More sharing options...
Barand Posted April 6, 2007 Share Posted April 6, 2007 See http://www.phpfreaks.com/forums/index.php/topic,133632.msg563570.html#msg563570 Link to comment https://forums.phpfreaks.com/topic/45072-category-breadcrumbs/#findComment-222715 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.