| | |
|
vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Re: passing form varible to ORDER BY clause |
From: |
Chris Mangano |
Date: |
3/13/2000 7:24:16 PM |
IP: |
205.143.193.79 |
Try this:
Lets say you have a form, and the can order it by a select box, named orderby. It contains 4 options, make, model, year, mileage. So, the select looks like:
<SELECT NAME="orderby">
<OPTION VALUE="make">Make</OPTION>
<OPTION VALUE="model">Model</OPTION>
<OPTION VALUE="year">Year</OPTION>
<OPTION VALUE="mileage">Mileage</OPTION>
</SELECT>
Now, if the user chooses say Model, and hits submit, you run a sql query like this:
"select * from tablName " &_
"order by " & orderby ""
This will order the query by Model, since that is the value of the orderby field.
Hope this helps
|
Previous Message
|
|
|
|
|
|