Parent Child Data - Populate within a Dropdown
Hi All ...
I have a mysql database with the following fields
ID (Int) - Title (VarChar) - ParentID (Int)
This table is used to display categories with it's parent. Categories with the ParentID of 0 means that it is a root category.
What'm trying to do is query the database and populate all values (with it's parent & child(s)) within a regular html dropdown box.
So the output of the dropdown whould look like:
Home
Home > Sub Cat 1
Home > Sub Cat 1 > Sub Sub Cat 1
Home > Sub Cat 1 > Sub Sub Cat 2
Home > Sub Cat 1 > Sub Sub Cat 3
Home > Sub Cat 2 > Sub Sub Cat 1
Home > Sub Cat 2 > Sub Sub Cat 2
Home > Sub Cat 3
Home > Sub Cat 4
Home > Sub Cat 4 > Sub Sub Cat 1
Home > Sub Cat 5
Any ideas on how I can accomplish this?
Many Thanks
Shafiq
