Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe folgendes Problem. Ich habe eine MySQL-DB die Einträge zur Navigation enthält. Beispiel:


---------------------------------------------

| ID | Parent_ID | Name       | Link        |

---------------------------------------------

| 1  | 0         | Home       | home.htm    |

---------------------------------------------

| 2  | 1         | Über mich  | me.htm      |

---------------------------------------------

| 3  | 2         | Freunde    | friends.htm |

---------------------------------------------

| 4  | 3         | Freund 1   | friend1.htm |

---------------------------------------------

| 5  | 2         | Eltern     | parents.htm |

---------------------------------------------

| 6  | 5         | Vater      | dad.htm     |

---------------------------------------------

Jetzt möchte ich gerne dynamisch einen Navtree erzeugen. Die Seiten werden auf meiner HP anhand der ID aufgerufen. Ich möchte also, wenn ich auf Vater gehe, dass er erkennt, dass darüber dann Eltern, darüber Über mich und darüber dann Home kommt.

Oder wenn ich auf Freund 1 gehe, dass darüber Freunde, darüber Über mich und darüber dann Home kommt.

Und so solls fertig aussehen: Home > Über mich > Freunde > Freund 1

Oder: Home > Über mich > Eltern > Vater

Leider fehlt mir absolut die Idee, wie ich das machen kann. Habt Ihr Hilfe? Vielen Dank.

Hallo,

Du musst eine Rekursion implementieren, entweder in PHP oder über eine Stored Procedure, die Dir dann das fertige Menü als Navigation liefert


function tree(id) {

     select * from tabelle where parent=id

     for results

          print result.data

          tree(results.id);

     endfor

}

HTH

Phil

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.