通过username为什么两个表不能互联。。。

hrxnoise 2006-05-20 01:59:08
<%dim userid,rsUser,UserNum
userid=SafeRequest("id",1)
set rs=server.createobject("adodb.recordset")
rs.open "select * from [user] where userid="&userid ,conn,1,1
%>
<tr>
<td valign="top" bgcolor="#FFFFFF"> <br/>
<table width="95%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#FFFFFF">
<td width="20%" height="23"> 用户名称:</td>
<td width="80%"> <font color=#FF6600><%=trim(rs("username"))%></font></td>
</tr>
<%rs.close
set rs=nothing
%>

<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from [orders] where username="&username ,conn,1,1
%>

<tr bgcolor="#FFFFFF">
<td height="21" colspan="2">名称:<%=trim(rs("goods"))%>123</td>
</tr>

<%rs.close
set rs=nothing
conn.close
set conn=nothing%>
...全文
86 2 打赏 收藏 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
sun30 2006-05-20
  • 打赏
  • 举报
回复
你可以把SQL语句打印出来,在SQL的查询分析器里执行一下,看有没有错误.这样调试最快!
sy_binbin 2006-05-20
  • 打赏
  • 举报
回复
我想在数据库里你的username的字段应该是字符串类型的吧

rs.open "select * from [orders] where username='"&username&"' ,conn,1,1

改下这个语句看看

28,402

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧