Categories and subcategories

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ab123
Forum Newbie
Posts: 1
Joined: Thu Jan 22, 2009 1:25 pm

Categories and subcategories

Post 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>;
}
}
 
}
 
Post Reply