Hierarchical categories structure my-sql and PHP

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
bharat123
Forum Newbie
Posts: 9
Joined: Mon Mar 17, 2008 7:14 am

Hierarchical categories structure my-sql and PHP

Post by bharat123 »

Hello Everyone

1) I need to store in My SQL database a hierarchical categories structure that allows
for unlimited 10 level depth.

The example table structure
Categories
----------
ID (INT)
ParentID (INT)
Name (VARCHAR(255))

We are write the query the hierarchy but some sql error, please guide me how the write hierarchy level query in PHP - mysql
if any one example guide me.

Thanks
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Hierarchical categories structure my-sql and PHP

Post by VladSun »

There are 10 types of people in this world, those who understand binary and those who don't
rcastera
Forum Newbie
Posts: 4
Joined: Wed Mar 11, 2009 8:07 pm

Re: Hierarchical categories structure my-sql and PHP

Post by rcastera »

Hey,

There's also a good tutorial on here http://www.sitepoint.com/article/hierar ... -database/
Post Reply