jojomart Posted November 22, 2007 Share Posted November 22, 2007 I hope someone can help me with this I am using a directory script, but the category pull down menu in admin is not what I want. All it does is list the parent, and the child of the parent, not the child of the child. It makes it hard to find the subsubs easily this way. Some of my categories have 4 levels, but all it shows is: Parent child child child with no indentation for the different subcategories. Here's what I really want Parent - child -- child of child --- child of child of child Here is the code: #catRSelEditPage -- Recursive category select that stops when id is found /* int $idF, mysql query result $fatherR, mysql connecion $myconn */ function catRSelEditPage($idF,$fatherR,$myconn){ while($father = mysql_fetch_assoc($fatherR)){ if($father['id'] == $idF) $selected = ' selected '; if($father['fatherID'] == 0) print '<option value="'.$father['id'].'"'.$selected.'>*'.$father['title'].'</option>'; else print '<option value="'.$father['id'].'"'.$selected.'> '.$father['title'].'</option>'; $selected = ''; $sql = "select * from categories where fatherID = '" . $father['id'] . "'"; $R = mysql_query($sql,$myconn) or die(mysql_error()); catRSelEditPage($idF,$R,$myconn); }//end while }//end function Is there anyone out there who can help me, please? Thanks, Joanne Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.