Hallo,
ich möchte aus einer DB eine Navigation erstellen.
Das Ganze soll eine Baumstruktur darstellen:
Leider klappt das so nicht!!!
Wie bekomme ich das hin???
VG, GN
ich möchte aus einer DB eine Navigation erstellen.
Das Ganze soll eine Baumstruktur darstellen:
HTML-Code:
<ul id="tree"> <li> Level 1 <ul> <li> Level 1.1 <ul> <li> Level 1.1.1 </li> </ul> </li> <li> Level 1.1 </li> </ul> </li> <li> Level 2 <ul> <li> Level 2.1 </li> </ul> </li> </ul>
PHP-Code:
echo "<ul id=\"tree\">\n";
while ($row_l = mysql_fetch_array($result_l, MYSQL_ASSOC))
{
echo " <li>". $row_l['name'];
while ($row_o = mysql_fetch_array($result_o, MYSQL_ASSOC))
{
echo " <ul>\n";
echo " <li>". $row_o['PLZ'] ." ". $row_o['ort'];
while ($row_s = mysql_fetch_array($result_s, MYSQL_ASSOC))
{
echo " <ul>\n";
echo " <li>". $row_s['schule'] ."</li>\n";
echo "</ul>\n";
}
echo "</li>\n";
echo "</ul>\n";
}
echo "</li>\n";
}
echo "</ul>\n";
VG, GN
Kommentar