![]() |
#2
lxb05922014-03-01 12:07
|
只有本站会员才能查看附件,请 登录
(图1)只有本站会员才能查看附件,请 登录
(图2)下面是这2段代码!

<%
sql="select * from leib order by id"
set rs_zu=conn.execute(sql)
if rs_zu.eof then
%>
<script language="javascript">
alert("请先添加工作类别!")
window.location.href="leib_add.asp"
</script>
<%
response.end
end if
%>
<select name="id_zu">
<%
do while rs_zu.eof=false
%>
<option value="<%=rs_zu("id")%>"<%if rs_zu("id")=rs("id_zu") then%> selected="selected"<%end if%>><%=rs_zu("zu")%></option>
<%
rs_zu.movenext
loop
%>
</select><%
sql="select * from leib order by id"
set rs_zu=conn.execute(sql)
if rs_zu.eof then
%>
<script language="javascript">
alert("请先添加工作类别!")
window.location.href="leib_add.asp"
</script>
<%
response.end
end if
%>
<select name="id_zu">
<%
do while rs_zu.eof=false
%>
<option value="<%=rs_zu("id")%>"<%if rs_zu("id")=rs("id_zu") then%> selected="selected"<%end if%>><%=rs_zu("zu")%></option>
<%
rs_zu.movenext
loop
%>
</select><%

sql="select * from jtfs order by id"
set rs_jtfs=conn.execute(sql)
if rs_jtfs.eof then
%>
<script language="javascript">
alert("请先添加工作类别!")
window.location.href="jtfs_add.asp"
</script>
<%
response.end
end if
%>
<select name="id_jtfs">
<%
do while rs_jtfs.eof=false
%>
<option value="<%=rs_jtfs("id")%>"<%if rs_jtfs("id")=rs("id_jtfs") then%> selected="selected"<%end if%>><%=rs_jtfs("jtfs")%></option>
<%
rs_jtfs.movenext
loop
%>
</select>
代码除了数据库表字段名改了!其他一模一样! 怎么效果不一样?set rs_jtfs=conn.execute(sql)
if rs_jtfs.eof then
%>
<script language="javascript">
alert("请先添加工作类别!")
window.location.href="jtfs_add.asp"
</script>
<%
response.end
end if
%>
<select name="id_jtfs">
<%
do while rs_jtfs.eof=false
%>
<option value="<%=rs_jtfs("id")%>"<%if rs_jtfs("id")=rs("id_jtfs") then%> selected="selected"<%end if%>><%=rs_jtfs("jtfs")%></option>
<%
rs_jtfs.movenext
loop
%>
</select>
[ 本帖最后由 lxb0592 于 2014-2-28 23:12 编辑 ]