Monday, 9 September 2013

how to get bottom to top level category array?

how to get bottom to top level category array?


in this table we create multiple level sub category with using
'parent_category_id' then how to get this type of array using query or php
code
Expected Output :
i can search category_id=7 and it return bottom to top levev category
in this case 7 is child of 10 , 10 is child of 1 and 1 is top level category
Array
(
[0] => Array
(
[category_id] => 1
[category_name] => Business Cards
),
[1] => Array
(
[category_id] => 10
[category_name] => One Sided
),
[2] => Array
(
[category_id] => 7
[category_name] => Standard
)
)

No comments:

Post a Comment