benim mysql veritabanına kaydedilir benim kategorilerin bir ağaç, göstermek gerekir.
Veritabanı tablosu:
table: kediler:
columns: id,name,parent problem is in php part :
//function to build tree menu from db table test1
function tree_set($index)
{
global $menu;
$q=mysql_query("select * from cats where parent='$index'");
if(!mysql_num_rows($q))
return;
$menu .= '<ul>'."\n";
while($arr=mysql_fetch_assoc($q))
{
$menu .= '<li>';
$menu .= '<span class="file">'.$arr['name'].'</span>';//you can add another output there
$menu .=tree_set("".$arr['id']."");
$menu .= '</li>'."\n";
}
$menu.= '</ul>'."\n";
return $menu;
}
//variable $menu must be defined before the function call
$menu = '
<link rel="stylesheet" href="modules/Topics/includes/jquery.treeview.css" />
<script src="modules/Topics/includes/lib/jquery.cookie.js" type="text/javascript"></script>
<script src="modules/Topics/includes/jquery.treeview.js" type="text/javascript"></script>
<script type="text/javascript" src="modules/Topics/includes/demo/demo.js"></script>
<ul id="browser" class="filetree">'."\n";
$menu .= tree_set(0);
$menu .= '</ul>';
echo $menu;
i even asked in this forum : http://forums.tizag.com/showthread.php?p=60649
problem is in php part of my codes that i mentioned . i cant show sub menus , i mean , really i dont know how to show sub menus
Burada bana yardım kodlayıcı yanlısı bir php herhangi bir şans var mı?