Visualizzazione dei risultati da 1 a 3 su 3

Discussione: menu cosa strana

  1. #1

    menu cosa strana

    qualche buona anima sa dirmi perchè il menu identico al menu che si trova a questo link:
    http://blog.html.it/archivi/2006/01/...-4-livelli.php

    ...quando provo a renderlo dinamico non pesca proprio tutte le voci ma alcune le salta?

    ho 1 tabella chiamata MENU e i campi della tabella sono:
    IDMenu (contatore)
    IDPadre (numerico)
    voce (testo)
    posizione (numerico)
    IDPagina (numerico)

    ----------

    questo il codice della pagina da me fatta:
    --------------------------------------------------------------
    <%
    Dim IDMenu1
    set Menu = Server.CreateObject("ADODB.Recordset")
    sql = "select * from Menu "
    Menu.ActiveConnection = cn
    Menu.Open sql, cn
    %>
    <ul id="navmenu">
    <%
    Do while not Menu.EOF
    IDMenu1 = Menu("IDMenu")
    if Menu("IDPadre") = 0 then
    %>
    <%if (Menu("IDPagina")) = 0 then%>[*]<%=Menu("voce")%>
    <%else%>[*]"><%=Menu("voce")%>
    <%end if%>

    <%
    Dim apro, chiudo, IDMenu2
    set Menu2 = Server.CreateObject("ADODB.Recordset")
    sql = "select * from Menu where IDPadre = " & IDMenu1
    Menu2.ActiveConnection = cn
    Menu2.Open sql, cn
    %>
    <%
    IF Menu2.EOF or Menu2.BOF then
    else
    apro = false
    Do while not Menu2.EOF
    IDMenu2 = Menu2("IDMenu")
    If apro = false Then
    %>
    <ul>
    <%
    apro = true
    end if
    %>
    <%if (Menu2("IDPagina")) = 0 then%>[*]<%=Menu2("voce")%>
    <%else%>
    [*]"><%=Menu2("voce")%>
    <%end if%>
    <%
    Menu2.movenext
    loop
    %>

    <%
    Dim IDMenu3
    set Menu3 = Server.CreateObject("ADODB.Recordset")
    sql = "select * from Menu where IDPadre = " & IDMenu2
    Menu3.ActiveConnection = cn
    Menu3.Open sql, cn
    %>
    <%
    IF Menu3.EOF or Menu3.BOF then
    else
    apro = false
    Do while not Menu3.EOF
    IDMenu3 = Menu3("IDMenu")
    If apro = false Then
    %>
    <ul>
    <%
    apro = true
    end if
    %>
    <%if (Menu3("IDPagina")) = 0 then%>[*]<%=Menu3("voce")%>
    <%else%>[*]"><%=Menu3("voce")%>
    <%end if%>
    <%
    Menu3.movenext
    loop
    %>

    <%

    set Menu4 = Server.CreateObject("ADODB.Recordset")
    sql = "select * from Menu where IDPadre = " & IDMenu3
    Menu4.ActiveConnection = cn
    Menu4.Open sql, cn
    %>
    <%
    IF Menu4.EOF or Menu4.BOF then
    else
    apro = false
    Do while not Menu4.EOF
    If apro = false Then
    %>
    <ul>
    <%
    apro = true
    end if
    %>
    <%if (Menu4("IDPagina")) = 0 then%>[*]<%=Menu4("voce")%>
    <%else%>[*]"><%=Menu4("voce")%>
    <%end if%>
    <%
    Menu4.movenext
    loop
    %>[/list]
    <%
    end if
    Menu4.close()
    Set Menu4 = nothing
    %> [/list]
    <%
    end if
    Menu3.close()
    Set Menu3 = nothing
    %> [/list]
    <%
    end if
    Menu2.close()
    Set Menu2 = nothing
    end if
    Menu.movenext
    loop
    %>[/list]
    <%
    Menu.close()
    Set Menu = nothing
    %>
    --------------------------------------------------------------

    è che non mi pesca tutte le voci che ho nel DB helllppp e non riesco a trovare un possibile errore sui vari cicli

  2. #2
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400
    perchè non è fatto per il tuo scopo... cerca nel forum ci sono decine di esempi che ti puoi personalizzare...

  3. #3
    azz.... pekkato era davvero bellino

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.