W
williamguo188
Unregistered / Unconfirmed
GUEST, unregistred user!
<%@LANGUAGE="VBSCRIPT"
CODEPAGE="950"%>
<!--#include file="conn.asp"
-->
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html;
charset=big5">
<title>sqltable</title>
</head>
<body>
<form name="form1"
method="post"
action="">
<table width="700"
border="1"
align="center">
<tr>
<td width="170">bigtypename</td>
<td width="175"><select name="select1"
style="width:160px ">
<option value="-">請選擇大類別</option>
<%
strsql="select * from bigtype"
set rs=conn.execute(strsql)
do
until rs.eof
big_id=trim(rs.fields(0).value)
big_id_name=trim(rs.fields(1).value)
%>
<option value=<%=big_id%>><%=big_id_name%></option>
<%
rs.movenext
loop
rs.close
rs=null
%>
</select></td>
<td width="170">billtypename</td>
<td width="160"><select name="select2"
style="width:160px ">
<option value="-">請選擇小類別</option>
<%
strsql1="select * from smalltype where nametype=big_id_name> "
set rs=conn.execute(strsql1)
do
until rs.eof
billid=trim(rs.fields(1).value)
%>
<option value="-"><%=billid%></option>
<%
rs.movenext
loop
rs.close
rs=null
%>
</select></td>
</tr>
</table>
<table width="700"
border="1"
align="center">
<tr>
<td width="100">id</td>
<td width="150">name</td>
<td width="150">nametype</td>
<td width="150">prise</td>
<td width="150">number</td>
</tr>
</table>
<p> </p>
</form>
</body>
</html>
這里面有兩個表,有一個相同的字段.
我想在第二個sql語句引big_id_name變量!
請高手指點,多謝?
CODEPAGE="950"%>
<!--#include file="conn.asp"
-->
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html;
charset=big5">
<title>sqltable</title>
</head>
<body>
<form name="form1"
method="post"
action="">
<table width="700"
border="1"
align="center">
<tr>
<td width="170">bigtypename</td>
<td width="175"><select name="select1"
style="width:160px ">
<option value="-">請選擇大類別</option>
<%
strsql="select * from bigtype"
set rs=conn.execute(strsql)
do
until rs.eof
big_id=trim(rs.fields(0).value)
big_id_name=trim(rs.fields(1).value)
%>
<option value=<%=big_id%>><%=big_id_name%></option>
<%
rs.movenext
loop
rs.close
rs=null
%>
</select></td>
<td width="170">billtypename</td>
<td width="160"><select name="select2"
style="width:160px ">
<option value="-">請選擇小類別</option>
<%
strsql1="select * from smalltype where nametype=big_id_name> "
set rs=conn.execute(strsql1)
do
until rs.eof
billid=trim(rs.fields(1).value)
%>
<option value="-"><%=billid%></option>
<%
rs.movenext
loop
rs.close
rs=null
%>
</select></td>
</tr>
</table>
<table width="700"
border="1"
align="center">
<tr>
<td width="100">id</td>
<td width="150">name</td>
<td width="150">nametype</td>
<td width="150">prise</td>
<td width="150">number</td>
</tr>
</table>
<p> </p>
</form>
</body>
</html>
這里面有兩個表,有一個相同的字段.
我想在第二個sql語句引big_id_name變量!
請高手指點,多謝?