gracenmy
03-27-2004, 01:31 PM
HI there,
I"m having a problem with the SQL statement processing the input from the form so that it will list down the flight detail based on the destination selected from the form.
Is there anythin wrong with the sql queries here, especially the one referring to the form input? I"m using Javascript.
<%@ LANGUAGE="Javascript" %>
<!--#include file="Connections/connAirline.asp" -->
<!--#include file="searchFlight.html" -->
<%
var From = Request.Form("from");
//var strTo = Request("to");
var rsFlight = Server.CreateObject("ADODB.Recordset");
rsFlight.ActiveConnection = MM_connAirline_STRING;
rsFlight.Source = "SELECT FLIGHT_NUM, FLIGHT_DATE, FLIGHT_FROM, FLIGHT_TO, FLIGHT_DEPARTIME, FLIGHT_PRICE FROM FLIGHT WHERE FLIGHT_FROM = '"+ From +"'";
rsFlight.CursorType = 0;
rsFlight.CursorLocation = 2;
rsFlight.LockType = 1;
rsFlight.Open();
var rsFlight_numRows = 0;
%>
<table width="80%" border="1" cellspacing="2" cellpadding="2">
<tr>
<td>FLIGHT NUM</td>
<td>DATE</td>
<td>FROM</td>
<td>TO</td>
<td>DEPARTURE</td>
<td>PRICE</td>
</tr>
<% while ((Repeat1__numRows-- != 0) && (!rsFlight.EOF)) { %>
<tr>
<td><%=(rsFlight.Fields.Item("FLIGHT_NUM").Value)%></td>
<td><%=(rsFlight.Fields.Item("FLIGHT_DATE").Value)%></td>
<td><%=(rsFlight.Fields.Item("FLIGHT_FROM").Value)%></td>
<td><%=(rsFlight.Fields.Item("FLIGHT_TO").Value)%></td>
<td><%=(rsFlight.Fields.Item("FLIGHT_DEPARTIME").Value)%></td>
<td><%=(rsFlight.Fields.Item("FLIGHT_PRICE").Value)%></td>
</tr>
<%
Repeat1__index++;
rsFlight.MoveNext();
}
%>
</table>
<p> </p>
</body>
</html>
<%
rsFlight.Close();
%>
Thanks for your help!
I"m having a problem with the SQL statement processing the input from the form so that it will list down the flight detail based on the destination selected from the form.
Is there anythin wrong with the sql queries here, especially the one referring to the form input? I"m using Javascript.
<%@ LANGUAGE="Javascript" %>
<!--#include file="Connections/connAirline.asp" -->
<!--#include file="searchFlight.html" -->
<%
var From = Request.Form("from");
//var strTo = Request("to");
var rsFlight = Server.CreateObject("ADODB.Recordset");
rsFlight.ActiveConnection = MM_connAirline_STRING;
rsFlight.Source = "SELECT FLIGHT_NUM, FLIGHT_DATE, FLIGHT_FROM, FLIGHT_TO, FLIGHT_DEPARTIME, FLIGHT_PRICE FROM FLIGHT WHERE FLIGHT_FROM = '"+ From +"'";
rsFlight.CursorType = 0;
rsFlight.CursorLocation = 2;
rsFlight.LockType = 1;
rsFlight.Open();
var rsFlight_numRows = 0;
%>
<table width="80%" border="1" cellspacing="2" cellpadding="2">
<tr>
<td>FLIGHT NUM</td>
<td>DATE</td>
<td>FROM</td>
<td>TO</td>
<td>DEPARTURE</td>
<td>PRICE</td>
</tr>
<% while ((Repeat1__numRows-- != 0) && (!rsFlight.EOF)) { %>
<tr>
<td><%=(rsFlight.Fields.Item("FLIGHT_NUM").Value)%></td>
<td><%=(rsFlight.Fields.Item("FLIGHT_DATE").Value)%></td>
<td><%=(rsFlight.Fields.Item("FLIGHT_FROM").Value)%></td>
<td><%=(rsFlight.Fields.Item("FLIGHT_TO").Value)%></td>
<td><%=(rsFlight.Fields.Item("FLIGHT_DEPARTIME").Value)%></td>
<td><%=(rsFlight.Fields.Item("FLIGHT_PRICE").Value)%></td>
</tr>
<%
Repeat1__index++;
rsFlight.MoveNext();
}
%>
</table>
<p> </p>
</body>
</html>
<%
rsFlight.Close();
%>
Thanks for your help!