<?php
include("config.php");

function showgroup($gnum, $lev) 
{ 
    $q = mysql_query("SELECT * FROM nodes WHERE parent=$gnum"); 
	echo "<select name=\"kategori\">";
    while ($q2 = mysql_fetch_array($q)) { 
        $space = "&nbsp;&nbsp;&nbsp;"; 

        $ttl = ""; 
        for ($i = 0; $i < $lev; $i++) { 
            $ttl .= $space; 
        } 
		
        echo $ttl."<option value=\"".$q2[id]."\">".$q2['cat_name']."</option>";
		 
        echo "<br />\n"; 
        $ttl .= $space . $space; 

        
        showgroup($q2['id'], $lev+1); 
    } 

	echo "</select>";
	
    if (mysql_num_rows($q) <= 0) { 
        return(0); 
    }   
}  

showgroup(0, 0);


?>
böyle bir şey denedim. bir sorun yok. fakat kategorilerin listesini select içinde göstermem lazım. bunu nasıl yapabilirim? yukarıda eklediğim select ve optionlarda her kategori, altkategori ve altkategorinin de altkategorisini de ayrı select menulerde gösteriyor.

www.wpturk.net/kat.php

bunu nasıl düzeltebilirim?