asp 错在那

来源:百度知道 编辑:UC知道 时间:2024/09/22 14:56:19
<!--#include file="init.asp"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=rs1("title")%></title>
</head>
<body>
<%
dim rs1,sq1
wzq=Request("wzq")
set rs1=server.CreateObject("ADODB.recordset")
sq1="select * from news where id="&wzq&""
rs1.open sq1,conn,1,1
%>
<table width="760" border="1" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td>
<%=rs1("title")%>
</td>
</tr>
<tr>
<td><%=rs1("content")%>
</td>
</tr></table>
<%
rs.close
conn.close
set rs=nothing
%>
</body>
</html>
运行后无显示内容 不报错 错在那

<title><%=rs1("title")%></title>
提取数据库的代码放到了<body>里,但是title里去获得数据集的字段...
肯定会出错的.
<%
dim rs1,sq1
wzq=Request("wzq")
set rs1=server.CreateObject("ADODB.recordset")
sq1="select * from news where id="&wzq&""
rs1.open sq1,conn,1,1
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=rs1("title")%></title>
</head>
<body>
<table width="760" border="1" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td>
<%=rs1("title")%>
</td>
</tr>
<tr>
<td><%=rs1("content")%>
</td>
</tr></table>
<%
rs.close
con