unlimited category problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tekinonline
Forum Newbie
Posts: 1
Joined: Tue Sep 12, 2006 5:31 pm

unlimited category problem

Post by tekinonline »

http://img170.imageshack.us/img170/3518/catdr1.jpg

i think you can see easier with the help of picture. how can i do category connections which you can see above.

product_detail.php?id=11 how can i do connection in the picture start with this catid. i would like to catch this picture, i mean used categories

ANASAYFA > Erkek > Cilt Bakım > Nivea > 20'li Yaşlarda > Nivea

feyd | 73K image, no thanks.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

start from the most specific category/product and fetch it's parent. Repeat until the parent_id of current category is 0. Then reverse the list of categories you assembled.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Storing Hierarchical Data in a Database gives another alternative.
Post Reply