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 3 levels, but all it shows is:
Parent
child
child
instead of:
Parent
- child
-- 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
Because it uses an if statement, is there only if and else (2 ways to show), or can it be modified to show what I want it to show?
I'd be soooo happy if you could figure this one out!
Joanne