高手看看我的代码,急等

来源:百度知道 编辑:UC知道 时间:2024/05/23 18:37:56
一个页面2个表格,点击表1,再表2显示!
<!--#include file="conn.asp" -->
<%
dim id2,id
id2=request.QueryString("id2")
set rs=server.createobject("adodb.recordset")
sql="select customer.customerid,customer.customername,booking.bongkingdate from customer left join booking on customer.customerid=booking.customerid where customerid=" & id2
rs.open sql,conn,1,3

%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>

<p align="left"> Customer</p>

<table width="383" height="58" border="1">

<tr>
<td height="24">customerid</td>
<td>customername</td>
</tr>
<% do until rs.eof

确认一下request.QueryString("id2")的值传过来了吗?id2得到参数了吗?

改为
id2=clng(request.QueryString("id2"))试试

sql语句有错,request.QueryString("id2")传来的是个字符串,不是数字改为:
sql="select customer.customerid,customer.customername,booking.bongkingdate from customer left join booking on customer.customerid=booking.customerid where customerid='"&id2&"'"

qaj b