|
以下这段程序是按 pinpai_id 排序的,那么,如果我想它按 pinpai_name 来排序的话,可以成功吗?
-------------------------------------------------
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from pinpai",conn,1,1
if rs.eof and rs.bof then
response.write "还没有商品分类信息,请添加!"
else
do while not rs.eof%><form method="post" action="ad_pinpai.asp?action=edit&pinpai_id=<%=rs("pinpai_id")%>">
<tr><td align="center" bgcolor="#FFFFFF"><%=rs("pinpai_id")%></td>
<td align="center" bgcolor="#FFFFFF">
<input name="pinpai_name" type="text" size="13" value="<%=rs("pinpai_name")%>"></td>
<td align="center" bgcolor="#FFFFFF">
<input name="pinpai_logo" type="text" size="8" value="<%=rs("pinpai_logo")%>"></td>
<td align="center" bgcolor="#FFFFFF">
<textarea rows="2" name="pinpai_content" cols="20"><%=rs("pinpai_content")%></textarea></td>
<td align="center" bgcolor="#FFFFFF">
<select size="1" name="pinpai_sort">
<%
set rsc=server.CreateObject("adodb.recordset")
rsc.open "select * from nsort",conn,1,1
do while not rsc.eof%>
<%if rsc("nsort_id")=rs("pinpai_sort") then%>
<option selected value="<%=rsc("nsort_id")%>"><%=rsc("nsort_name")%></option>
<%else%>
<option value="<%=rsc("nsort_id")%>"><%=rsc("nsort_name")%></option>
<%end if%>
<%
rsc.movenext
loop
rsc.close
set rsc=nothing
%>
-------------------------------------------------
谢谢大家指点。。。。。。。。。。。。。。。。。。。。。。。。 |
|