Ok now i have two tables one is category and the other is subcategory ok now my problem is that i want to put the heading as category and then subcategories should be displayed like this category 1 sub cat1 sub cat2 category2 sub cat1 sub cat2 i mean both will have different values and the table is like category id title sub cat id cat id title so can anyone help?? i know it will work with do while but still i am not able to do that..