Here is the code ...
<?php
$query = mysql_query("SELECT * FROM subjects");
while($fetch = mysql_fetch_array($query)){
echo "<li>" . $fetch["menu_name"] . "</li>";
echo "<ul>";
$query = mysql_query("SELECT * FROM pages WHERE subject_id = {$fetch["id"]}");
while($fetch = mysql_fetch_array($query)){
echo "<li>" . $fetch["menu_name"] . "</li>";}
echo "</ul>";
}?>
the problem is that it gets one "subject" and the rest of the "pages" under it ...
I want it to get all subjects and all pages under it
I hope that you understood me Thanks in advance FarrisFahad