主题:请各位看看这段代码错在哪里??
向tdxx中的tdlx中添加了值11,12,13,14,15,16,
为什么插入表格中后不管选几,都是显示11呢??
向数据库中添加数据
<%stdlx=request("tdlx")%><select name="tdlx" id="select28">
<option value="">请选择</option>
<option value="11" <%if stdlx="11" then Response.write("selected")%>>出售</option>
<option value="12" <%if stdlx="12" then Response.write("selected")%>>出租</option>
<option value="13" <%if stdlx="13" then Response.write("selected")%>>求购</option>
<option value="14" <%if stdlx="14" then Response.write("selected")%>>求租</option>
<option value="15" <%if stdlx="15" then Response.write("selected")%>>转让</option>
<option value="16" <%if stdlx="16" then Response.write("selected")%>>招商合作</option>
</select>
插入表格的部分:
conn.execute sql
Set Rs=Server.CreateObject("adodb.recordset")
SQL="select * from tdxx where tdlx='11'"
rs.open sql,conn,1,1
if not rs.eof then
tdlx_1=trim(rs("tdlx"))
<%if tdlx_1="11" thenresponse.write "<font color=#CC0000>出售</font>"
elseif tdlx_1="12" thenresponse.write "<font color=#006699>出租</font>"
elseif tdlx_1="13" thenresponse.write "<font color=#333333>转让</font>"
elseif tdlx_1="14" thenresponse.write "<font color=#0000FF>求租</font>"
elseif tdlx_1="15" thenresponse.write "<font color=#FF9900>求购</font>"
elseif tdlx_1="16" thenresponse.write "<font color=#FF9900>招商合作</font>"
end if
%>
为什么插入表格中后不管选几,都是显示11呢??
向数据库中添加数据
<%stdlx=request("tdlx")%><select name="tdlx" id="select28">
<option value="">请选择</option>
<option value="11" <%if stdlx="11" then Response.write("selected")%>>出售</option>
<option value="12" <%if stdlx="12" then Response.write("selected")%>>出租</option>
<option value="13" <%if stdlx="13" then Response.write("selected")%>>求购</option>
<option value="14" <%if stdlx="14" then Response.write("selected")%>>求租</option>
<option value="15" <%if stdlx="15" then Response.write("selected")%>>转让</option>
<option value="16" <%if stdlx="16" then Response.write("selected")%>>招商合作</option>
</select>
插入表格的部分:
conn.execute sql
Set Rs=Server.CreateObject("adodb.recordset")
SQL="select * from tdxx where tdlx='11'"
rs.open sql,conn,1,1
if not rs.eof then
tdlx_1=trim(rs("tdlx"))
<%if tdlx_1="11" thenresponse.write "<font color=#CC0000>出售</font>"
elseif tdlx_1="12" thenresponse.write "<font color=#006699>出租</font>"
elseif tdlx_1="13" thenresponse.write "<font color=#333333>转让</font>"
elseif tdlx_1="14" thenresponse.write "<font color=#0000FF>求租</font>"
elseif tdlx_1="15" thenresponse.write "<font color=#FF9900>求购</font>"
elseif tdlx_1="16" thenresponse.write "<font color=#FF9900>招商合作</font>"
end if
%>