Hi People, I am having displaying categories and subcategories:

i have one table where i ise parentid in the same table as:

pid, cat, parentid, details

i am able to list all cats/sub cats but i want to display as like this:

animal » doggie » companion

but my list does not appear like this:

when i select doggie it replaces animal rather than appearing against it.

well i thought using left outer joins to go three level deep..

what if i gave 15 levels deep. then how can i make this work. 15 left outer joins is too much.

i am using mysql for this. is any function build in mysql or mssql server to make this workaround,

if not then how we can do it in programmtic way.

Cheers

Create a self-referencing table whereparentid catsas a foreign key linking to the pid within the same table. This is useful for hierarchical data, like categories.

commented: May want to avoid 15 year old discussions. -4
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.