Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Scegli la lettera

  1. #1

    Scegli la lettera

    CIao a tutti, spero di riuscire a spiegare in modo esauriente il mio ultimo problema...

    Allora....

    Ho un db in cui in una tabella nel campo titolo ho diversi nomi di ricette. devo impaginarle facendo in modo che il risultato sia simile a questo

    cioè divise per lettera iniziale... come fare????
    Parafarmacia online, tantissimi prodotti tutti in un click

  2. #2
    Non so se è quello che volevi
    codice:
    <% 
    
    
    '******    da personalizzare    **********
    
    campo = "nome"
    testo= "testo"
    tabella = "tabella_nomi"
    nome_database = "./alfabeto.mdb"
    colore_sfondo= "#FFFFFF"
    
    '******   fine personalizzazione    **********
    
    set Con = server.CreateObject("adodb.connection")
        Con.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&Server.MapPath( nome_database )
    
    
    nome =""
    lettera =request.querystring ("lettera")
    
    visualizza_alfabeto
    
    if lettera <>"" then 
    estrai_da_database	
    end if 
    
    
    
    Con.Close
    
    sub estrai_da_database
    
    
    
    sqlstring3 = "select " & campo & "  from " & tabella & " where " & campo & " like '" & lettera & "%' order by " & campo & ""
    Set RS = Con.execute(sqlstring3)
    
    	bolfound2 = "false"
    
    	Do until RS.EOF 
    				nome =RS(campo)
    				
    				
    				bolfound2 = "true"
    				visualizza_nomi
    			RS.movenext
    			
    	loop
    
    	if bolfound2 = "false" then
    		response.write("<table align = center><tr><td  align =center>")	
    		response.write("
    nessun record presente")
    		response.write("</td></tr></table>")
    
    
    	end if
    
    
    
    
    
    
    end sub 
    
    sub visualizza_nomi
    
    %>
    <a href='pagina_dettaglio.asp?nome=<%=nome%>'>
    <%=nome%>
    </a>
    
    
    <%
    end sub 
    
     sub visualizza_alfabeto
    %>
    <html>
    <head>
    <title> RISORSE.NET -- Ricerca per lettera dell'alfabeto</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body bgcolor=<%=colore_sfondo%> text="#000000">
    <table width="29%" border="0" height="32">
      <tr>
        <td width="5%"> 
          A
      </td>
            <td width="5%"> 
          B
      </td>
    <td width="5%"> 
          C
      </td>
    <td width="5%"> 
          D
      </td>
    <td width="5%"> 
          E
      </td>
    <td width="5%"> 
          F
      </td>
    <td width="5%"> 
          G
      </td>
    <td width="5%"> 
          H
      </td>
    <td width="5%"> 
          I
      </td>
    <td width="5%"> 
          J
      </td>
    <td width="5%"> 
          K
      </td>
    <td width="5%"> 
          L
      </td>
    <td width="5%"> 
          M
      </td>
    <td width="5%"> 
          N
      </td>
    <td width="5%"> 
          O
      </td>
    <td width="5%"> 
          P
      </td>
    <td width="5%"> 
          Q
      </td>
    <td width="5%"> 
          R
      </td>
    <td width="5%"> 
          S
      </td>
    <td width="5%"> 
          T
      </td>
    <td width="5%"> 
          U
      </td>
    <td width="5%"> 
          V
      </td>
    <td width="5%"> 
          W
      </td>
    <td width="5%"> 
          X
      </td>
    <td width="5%"> 
          Y
      </td>
    <td width="5%"> 
          Z
      </td>
    
      </tr>
    </table>
    </body>
    </html>
    <% end sub%>

  3. #3

    x michele

    :yuppi:
    ciao,
    era quello che cercavo da un po di tempo,

    solo che a questo non riesco ad aggiungere la paginazione x pagina.


    cioè

    una volta cliccato sulla lettera "A" i risultati dovrebbero essere suddivisi x pagina.

    sapreste aiutarmi???? :confused:

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.