I wrote the following code in php but when i click on the node, the link ;doesn't work
<?php
function get_menu_tree($parent_id)
{
global $conn;
$menu = "";
//$sqlquery = " SELECT linkpage,moduleid,menuid,menuname,parentid,menudisplay FROM admnmenumaster where menudisplay='Y' and parentid='" .$parent_id . "' ";
$sqlquery = " SELECT linkpage,moduleid,menuid,menuname,parentid,menudisplay FROM admnmenumaster where menudisplay='Y' and parentid='" .$parent_id . "' ";
$result=sqlsrv_query($conn,$sqlquery);
while($row = sqlsrv_fetch_array($result,SQLSRV_FETCH_ASSOC))
{
$menu .="<li class=treeview><a href='".$row['linkpage']."'>".$row['menuname']."</a>";
$menu .= "<ul class=treeview-menu>".get_menu_tree($row['menuid'])."</ul>"; //call recursively
$menu .= "</li>";
//echo "HELLO<a href=$row[linkpage]>$row[menuname]</a>";
}
return $menu;
}
?>
<?php echo get_menu_tree(0); //start from root menus having parent id 0 ?>