Page 1 of 1

Categories and subcategories

Posted: Thu Jan 22, 2009 1:28 pm
by ab123
how do i go about selecting my sub categories into a while loop?

parent category (456)
subcategory (564)
subcategory (546)
subcategory (856)

ive tryed this method but shows nothing;

Code: Select all

 
while($parentblahh = mysql_fetch_array($parresult)) {
$parentcatid = $parentblahh['pid'];
 
while($blahh = mysql_fetch_array($result)) {
 
       if($parentcatid == $blahh['cat_id']) {
         echo "<a href="cat.php?cid=blahh"> subcatname </a>;
}
}
 
}