level 2
<%
set rs=server.createobject("adodb.recordset")
sql="select * from aspdesoft_Order where UserId =*"&rs_U("UserId")&"* order by id desc"
rs.Open sql,conn,1,1
do while not rs.eof
%>请问下,这个代码,为什么显示不了,要调用前后 我的订单 的代码。把UserId =*"&rs_U("UserId")&"*改成UserID,这样就能显示订单,但是会显示所有会员的订单,不能只显示会员本人的订单。
2014年08月14日 14点08分
1
level 2
=*"&rs_U("UserId")&"*,这里不是星号,是单引号+双引号
2014年08月15日 01点08分
3
level 2
<!--#include file="top.asp"-->
<table width="1000" border="0" align="center" cellpadding="0" cel
lsp
acing="0" bgcolor="#FFFFFF">
<tr>
<td width="190" valign="top"><!--#include file="uleft.html"--> </td>
<td width="810" valign="top"><table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr></tr>
<tr>
<td height="25" align="left" bgcolor="#EEEEEE"> <a href="index.asp">网站首页 </a> >> 我的订单 </td>
</tr>
<tr>
<td align="left" height="15"> </td>
</tr>
<tr></tr>
<tr></tr>
<tr>
<td align="left"><table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr>
<td><%
if request.cookies("usname")="" then
response.Write("<script>alert(""您末登陆,请先登陆您的会员!"");history.back(-2);</script>")
else%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#f2f2f2">
<tr align="center" bgcolor="#F7F7F7">
<td width="17%" height="25"><strong>订单号</strong></td>
<td width="16%"><strong>产品名称</strong></td>
<td width="9%"><strong>产品数量</strong></td>
<td width="9%" height="25"><strong>总计费用</strong></td>
<td width="25%" height="25"><strong>下订时间</strong></td>
<td width="24%" height="25"><strong>订单状态</strong></td>
</tr>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from aspdesoft_Order where UserId =*"&rs_U("UserId")&"* order by id desc"
rs.Open sql,conn,1,1
do while not rs.eof
%>
<tr bgcolor="#FFFFFF" align="center">
<td height="30" onmouseover="this.style.backgroundColor=*#f2f2f2*; this.style.color=*#ff0000* " onmouseout="this.style.backgroundColor=**;this.style.color=**"><% ordernum=replace(rs("OrderNum"),Request.Form("OrderNum"),"<font color=red>"&Request.Form("OrderNum")&"</font>") %>
<%= OrderNum %></td>
<%zongm=0
dis=Split(rs("cpin"), "|")
for h=0 to UBound(Split(rs("cpin"), "|"))
did=split(dis(h),",")
%>
<td onmouseover="this.style.backgroundColor=*#f2f2f2*; this.style.color=*#ff0000* " onmouseout="this.style.backgroundColor=**;this.style.color=**"><%=did(1)%></td>
<td onmouseover="this.style.backgroundColor=*#f2f2f2*; this.style.color=*#ff0000* " onmouseout="this.style.backgroundColor=**;this.style.color=**"><%=did(2)%></td>
<td height="30" onmouseover="this.style.backgroundColor=*#f2f2f2*; this.style.color=*#ff0000* " onmouseout="this.style.backgroundColor=**;this.style.color=**"><font color="#FF6600">¥ </font><font color="red"><b><%=rs("buyprice")%></b></font>
<%next%>
</td>
<td height="30" onmouseover="this.style.backgroundColor=*#f2f2f2*; this.style.color=*#ff0000* " onmouseout="this.style.backgroundColor=**;this.style.color=**"><font color="red"><b><%=rs("ordertime")%></b></font></td>
<td height="30" onmouseover="this.style.backgroundColor=*#f2f2f2*; this.style.color=*#ff0000* " onmouseout="this.style.backgroundColor=**;this.style.color=**"><strong>
<% If rs("Status")="0" or rs("Status")="" Then Response.Write("等待,订单正在处理")%>
<% If rs("Status")="1" Then Response.Write("订单已经处理,等待收获结算")%>
<% If rs("Status")="2" Then Response.Write("订单已经结算完成")%>
</strong></td>
</tr>
<% rs.movenext
loop
rs.close %>
</table></td>
</tr>
</table>
<% End If %></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
2014年08月15日 01点08分
4
level 2
sql="select * from aspdesoft_Order where UserId =*"&rs_U("UserId")&"* order by id desc"
rs.Open sql,conn,1,1
改成
sql="select * from aspdesoft_Order where UserId order by id desc"
rs.Open sql,conn,1,1
这样的话,就会把所有的会员订单全部列出来。不能只列会员自己的订单。好像一直无法从aspdesoft_order这个表中的userid读取内容。
2014年08月15日 01点08分
6
*"&rs_U("UserId")&"*这个事什么?单独输出一下看看~
2014年08月15日 03点08分
sql="select * from aspdesoft_Order where UserId order by id desc" rs.Open sql,conn,1,1 单独这样的,,会把所有会员的订单显示出来
2014年08月15日 03点08分
回复 陈旧1自相矛盾c :亲,我看得懂代码,我的意思是你输出一下 这个!看一下具体出来的东西和你想想中是否一样!
2014年08月16日 01点08分
那样网页一直处理空白状态,打不开,然后cpu开始占有率90%以上,卡死。
2014年08月16日 06点08分
level 6
一 你那个UserId 如果是数据类型为数字 那应该把*"&rs_U("UserId")&"* 改为 "&rs_U("UserId")&"
二 看你那个rs_U("UserId")返回的值是什么 再做相应的判断
其它代码到是没什么问题
记得踩我的网站 看签名
2014年08月15日 04点08分
8
UserId,这个是前台注册用户的会员名称。有数字,也有字母。&rs_u(“userid")&这样的话,运行不了,一运行,cpu就90%以上。
2014年08月15日 06点08分
level 10
sql="select * from aspdesoft_Order where UserId =‘ "&rs_U("UserId")&" ’ order by id desc"
2014年08月15日 09点08分
9
这样子是不行的。
2014年08月15日 10点08分
知道那里是单引。。。那样一直无法读取order表中的userid这个值,来判定。
2014年08月15日 10点08分
level 2
where UserId=*"&request.cookies("usname")("userid")&"*
改成这样,也是无法读取userid
2014年08月15日 10点08分
10
level 2
没有人懂得怎么弄吗???读取aspdesoft_order这个表中的userid一直无法读取。。。用cookie判定用户来选订单,也不行。。。有高手指教下吗
2014年08月16日 01点08分
11