Code: Select all
group_id group_parent group_name
1 0 test_Adminys
2 0 test_moderat
3 0 test_editors
4 0 test_authors
5 0 test_members
6 0 test_vistors
7 1 __ForumsAdmin
8 1 __PluginsAdmin
9 2 __ForumsModerator
10 2 __PluginModerator
11 3 __BlogEditor
12 3 __NewsEditor
13 3 __ArticleEditor
14 3 __ReviewsEditor
15 4 __BlogAuthor
16 4 __NewsAuthor
17 4 __ArticleAuthor
18 4 __ReviewsAuthor
19 5 __Subscribed
20 5 __FREE
21 6 __Regular
22 6 __NoProxy
23 6 __Hacker
24 23 Test Depth1
25 24 Test Depth2
26 25 Test Depth3
27 26 Test Depth4
28 27 Test Depth5Code: Select all
function showgroup($gnum, $lev)
{
$q = mysql_query(
"SELECT * FROM groups
WHERE group_parent=$gnum");
while ($q2 = mysql_fetch_array($q))
{
$space = " ";
$ttl = '';
for ($i = 0; $i < $lev; $i++)
$ttl .= $space;
echo $ttl. .$q2['group_name'];
echo "<br />";
$ttl .= $space . $space;
$links = mysql_query( 'SELECT * FROM groups
WHERE group_parent=' .
$q2['group_parent']);
while ($links2 = mysql_fetch_array($links))
{
echo $q2['group_name'];
echo "<br />";
}
showgroup($q2['id'], $lev+1);//*/
}
if (mysql_num_rows($q) <= 0)
return(0);
}any ideas as to howt o fix this?
thanx