php multilevel menu dropdown getting childs child
<p>I m writing a multilevel menu with the below code im able to get only the parent category and </p>

<p>it s child ,I NEED to get the childs child and so on and so forth</p>

<p>Please help me out::</p>

<pre><code>$resultMainMenu = mysql_query("SELECT menu.menu_id,menu.menu_name,menu.parent_id FROM 
menu,menu_users WHERE menu.parent_id=0 
 AND menu.something='x'
AND menu_users.menu_id = menu.menu_id AND menu_users.user_type=1 ") or die(mysql_error());


while($row = mysql_fetch_array($resultMainMenu)){

    echo $row['menu_name'] . '&lt;br /&gt;'; // echo main menu

    $resultSubmenu = mysql_query("SELECT * FROM menu WHERE parent_id='". $row['menu_id']."' AND menu.something='x'") or die(mysql_error());

    if(mysql_num_rows($resultSubmenu) &gt;= 1){

        while($rowSub = mysql_fetch_array($resultSubmenu)){

            echo ' -- ' . $rowSub['menu_name'] . '&lt;br /&gt;'; // echo sub menu

        }
    }
}
</code></pre>
