Pagina 1 di 4 1 2 3 ... ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 34

Discussione: Aiuto per pagina asp

  1. #1

    Aiuto per pagina asp

    In un file .asp faccio richiamare dal mio database i dati riguardanti una serie di prodotti,
    ID Nome prodotto descrizione Prezzo. vorrei sapere, se qualcuno lo sa, come faccio a sistemare i prodotti da quello che ha il prezzo più basso a quello che ha il prezzo più alto.
    Garazie.

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    codice:
    SELECT * FROM tabella ORDER BY prezzo
    Roby

  3. #3
    ma a che punto devo piazzare questa riga?

  4. #4
    Posta il codice della tua pagina?
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  5. #5
    E uno script che ho trovato su internet, a cui voglio aggiungere questa funzione, poi se ne avete uno migliore da suggerire vi ringrazio.
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

    <%
    dim rs
    dim rs2
    dim cn
    dim msg

    set cn = Server.CreateObject("Adodb.Connection")
    set rs = server.CreateObject("Adodb.Recordset")
    cn.Open conn
    sqlstring = "Select * From ProductCategories"
    rs.open sqlstring, cn


    %>
    <html>
    <head>
    <title>ASP Product Catalog</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    <link href="style.css" rel="stylesheet" type="text/css">
    <link href="images/style.css" rel="stylesheet" type="text/css">
    </head>

    <body>
    <div align="center">
    <table width="100%" border="0">
    <tr bgcolor="#FFFFCC">
    <td colspan="2"><div align="center"><font color="#000066" size="4" face="Georgia, Times New Roman, Times, serif">ASP
    Product Catalog</font><font size="4" face="Georgia, Times New Roman, Times, serif">

    <font color="#0000FF" size="2">A very simple way to show your company
    products online</font></font></div></td>
    </tr>
    <tr>
    <td colspan="2" valign="top">Home <a href="#">About
    us</a> Contact us</td>
    </tr>
    <tr>
    <td width="16%" valign="top"><table width="100%" border="1">
    <tr>
    <td><table width="100%" border="0">
    <tr>
    <td bgcolor="#FFFFCC">Product Categories</td>
    </tr>
    <%if not rs.eof then
    while not rs.eof
    %>
    <tr>
    <td>"><%= rs("CategoryName")%></td>
    </tr>
    <%
    rs.movenext
    wend
    end if
    %>
    </table>
    <form name="form1" method="post" action="search.asp">
    <input name="keywords" type="text" id="keywords" size="20">
    <input type="submit" name="Submit" value="Search">
    </form>


    </p>
    <table width="100%" border="0">
    <tr>
    <td bgcolor="#FFFFCC"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Links</font></td>
    </tr>
    <tr>
    <td><a href="http://www.sourcesystems.net" target="_blank">Source
    Systems</a></td>
    </tr>
    <tr>
    <td>w3code.com</td>
    </tr>
    <tr>
    <td>w3update.com</td>
    </tr>
    <tr>
    <td>jinnahsuper.com</td>
    </tr>
    </table>


    </p></td>
    </tr>
    </table>


    </p></td>
    <td width="84%" valign="top"> <div align="left">

    Welcome to ASP Product
    Catalog</p>
    <font color="#FF0000">
    <%if not request.QueryString("cid")<>"" then%>
    </font>

    Welcome message is placed here.......</p>
    <%end if%>
    <%
    if request.QueryString("cid")<>"" then
    set rs = cn.execute("Select * From Products Where CategoryID=" & request.QueryString("cid"))
    end if
    %>
    <%
    if not rs.eof then
    while not rs.eof
    %>
    <table width="100%" border="0">
    <tr>
    <td bgcolor="#FFFFCC"><%=rs.fields("productname")%></td>
    </tr>
    <%if rs.fields("image")<>"" then%>
    <tr>
    <td height="20">[img]images/products/<%=rs.fields([/img]" alt=""></td>
    </tr>
    <tr>
    <%end if%>
    <td height="20"> <div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Price:<font color="#FF0000">
    <%=rs.fields("price")%></font></font></div></td>
    </tr>
    <tr>
    <td><%=rs.fields("details")%></td>
    </tr>
    </table>


    <%
    rs.movenext
    wend
    else
    'response.Write("No products")
    end if
    %>


    </p>


    [img]images/banner1.jpg[/img]</p></td>
    </tr>
    <tr bgcolor="#FFFFCC">
    <td colspan="2" valign="top"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Powered
    by ASP Product Catalog - A project of <a href="Source%20Systems" target="_blank">Source
    Systems</a></font></div></td>
    </tr>
    </table>
    </div>
    </body>
    </html>

  6. #6
    codice:
    sqlstring = "Select * From ProductCategories ORDER BY prezzo"
    "prezzo": la tua colonna dei prezzi.
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  7. #7
    scusami ma dove la devo inserire all'interno di questo script

  8. #8
    Cerca nel codice della tua pagina "sqlstring" e sostituisci quella attuale con questa che ti ho postato.
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  9. #9
    adesso ci provo

  10. #10
    NON FUNZIONA

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 © 2026 vBulletin Solutions, Inc. All rights reserved.