Hello,
I am trying to add a link to the lowest final choice of each category.
Here is the code i have now:
function recur_menu($admin=0, $st=0, $cnt=1)
{
// cat_level3 : id3_cat, cat_name, level2_cat, graphic, html_graphic, active
$sql = "select id3_cat, cat_name from cat_level3
where level2_cat = $st and active <> 0 order by cat_name";
$res = $this->dbh->query($sql);
while ($res->fetchInto($row))
{
$html .= str_repeat("*",$cnt).$row['cat_name']."|".$row['id3_cat']."|".$nrows."|".$i."\n";
// if ( ( $nrows == $i ) && ($admin) ) { $html .= " - <a href='{$_SERVER['PHP_SELF']}?del={$row['id3_cat']}' onclick=\"return submitActionDEL();\">DELETE</a>"; }
$html .= "<BR>";
$html .= $this->recur_menu($admin, $row['id3_cat'], $cnt+1);
if ($st == 0) { $html .= "<BR>"; }
}
return $html;
}
This is what i am currently getting:
New Five|10
Adding to Five|11
Added to Added of Five|12
*New Four|9
New One|1
Sub 1 of One|3
Sub 2 of One|4
**Sub 3 of One|5
Sub 1 of One-2|8
*New Three|6
*New Two|2
**Sub 1 of Two|7
This is what I want.:
New Five|10
Adding to Five|11
Added to Added of Five|12 - DELETE
*New Four|9 - DELETE
New One|1
Sub 1 of One|3
Sub 2 of One|4
**Sub 3 of One|5 - DELETE
Sub 1 of One-2|8 - DELETE
*New Three|6 - DELETE
*New Two|2
**Sub 1 of Two|7 - DELETE
Any suggestions?
Thank you.